Spacing

  • Thread starter Thread starter john sutor
  • Start date Start date
John,

You can use the constructor for the string, like this:

// Create a string with 10 spaces
string pstrString = new string(' ', 10);

Hope this helps.
 
john said:
Is there a Space function in C# like there is in Visual Basic?


You can use one of the overloaded constructors for string to emulate it:

string spaceString = new string(' ', 10);

Also, have a look at the String.PadLeft() and String.PadRight() methods.
 
.... and do a search of the newsgroup first to see if the question was
already asked and answered
 
Back
Top