N Nicholas Paldino [.NET/C# MVP] May 5, 2004 #2 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, You can use the constructor for the string, like this: // Create a string with 10 spaces string pstrString = new string(' ', 10); Hope this helps.
E Ed Courtenay May 5, 2004 #3 john said: Is there a Space function in C# like there is in Visual Basic? Click to expand... 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.
john said: Is there a Space function in C# like there is in Visual Basic? Click to expand... 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.
J james May 5, 2004 #4 .... and do a search of the newsgroup first to see if the question was already asked and answered