Hello everyone,
For the following code, what means {0, 3}? I have searched MSDN but can not find the related format description.
[Code]
String.WriteLine ("{0, 3} : {1}", str1, str2);
[/Code]
thanks in advance,
George
Hello everyone,
For the following code, what means {0, 3}? I have searched MSDN but can not find the related format description.
[Code]
String.WriteLine ("{0, 3} : {1}", str1, str2);
[/Code]
thanks in advance,
George
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
George GeorgePosted Jul 27, 2008, 10:45 PM
Thanks Ryan!
Question answered.
regards,
George
Ryan AlfordPosted Jul 27, 2008, 10:52 AM
String.Format("{0,3}:{1}", str1, str1);
There is no "String.WriteLine" method.
2. "{0,3}" is used for padding/alignment of the string.
http://idunno.org/archive/2004/14/01/122.aspx