Formatting a C# string with identical spacing in between values

You can use advanced features of string.Format:

string.Format("{0,-10}{1,-10}{2}", ...)

You can do the same thing by writing str.PadRight(10)

Leave a Comment