I want to use c# format to do this:
6 = “000006”
999999 = “999999”
100 = “000100”
-72 = error
1000000 = error
I was trying to use String.Format but without success.
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.
Formatting will not produce an error if there are too many digits. You can achieve a left-padded 6 digit string just with
If you need 7 digit strings to be invalid, you’ll just need to code that.
To use string.Format, you would write