What I want to do, is make the text that I output via the Console.Writeline method line up perfectly regardless of length.
Example:
// Notice that no matter the length of the text on the left,
// the text on the right is always spaced at least 5 spaces.
this is output text
this is also output text
output text
my output text
Am I going to have to write my own method for this, or does .Net contain something that I can use already?
You can also take a look at this page that explains .NET string formatting. Instead of a manual
PadLeft
andPadRight
you can declare the padding size directly in your formatting string. Something along the lines ofSomething like this should work for you. Hopefully you can adapt it to your needs.
Think in Linq instead!
}