string strI;
for (int i = 1; i < 100; i++)
strI = i.ToString();
in here, if i = 1 then ToString yields "1"
But I want to get "01" or "001"
It looks quite easy, but there’s only article about
datetime.ToString("yyyy-MM-dd")`
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
or
depending on what you want
Look at the MSDN article on custom numeric format strings for more options: http://msdn.microsoft.com/en-us/library/0c899ak8(VS.71).aspx