I have to create a string that has a fixed amount of chars. The format says that the string must be filled with leading spaces in case it isn't long enough.
How can I (elegantly) add these leading spaces?
P.S. I know I could count the length of the string and a space till I fill it but... I feel like there's gotta be a easier (more elegant) way of doing it. Perhaps with regular expressions?
String.PadLeft Method (Int32, Char)
http://msdn.microsoft.com/en-us/library/92h5dc07.aspx