Alex Rivera | Logout

Alternatives to " " for creating strings containing multiple whitespace characters

Asked 2009-11-11T16:12:44.340
28

I'm wondering if there's a more OO way of creating spaces in C#.

Literally Space Code!

I currently have tabs += new String(" "); and I can't help but feel that this is somewhat reminiscent of using "" instead of String.Empty.

What can I use to create spaces that isn't " "?

Edit
Report

1 Answer

1

I think you are taking OO way to far.. A simple addition of a space does not need an entire class.

tabs += new String(' ');

or

tabs += " ";

is just fine.

answered 2009-11-11T16:31:09.347

Your Answer