{0,-12} is the part i'm curious about..
I'm looking at this example
Console.WriteLine("{0,-12} {1}", sqlReader.GetName(0),
sqlReader.GetName(1));
Cheers :)
The "0" part of "{0,-12}" says to take the first argument (sqlReader.GetName(0)). The "-12" part indicates that the string should be left-aligned, and that it should use 12 spaces (the field width). If the data doesn't use all 12 spaces, it will fill in the remaining spaces to make the string a total width of 12.
You can see all the options here: http://msdn.microsoft.com/en-us/library/txafckwd.aspx
from msdn
{index[,length][:formatString]}
length: The minimum number of characters in the string representation of the parameter. If positive, the parameter is right-aligned; if negative, it is left-aligned.
It is for string alignment.
http://www.csharp-examples.net/align-string-with-spaces/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With