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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Ryan AlfordRank #1,411 · 1.2K reputationPosted Jul 27, 2008, 6:52 AM EDT
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
George GeorgeRank #1,736 · 870 reputationPosted Jul 27, 2008, 6:45 PM EDT
Thanks Ryan!
Question answered.
regards,
George