SyntaxFix
Write A Post
Hire A Developer
Questions
.NET has an easy function to do that in the String class. Just use:
String
.ToString().PadLeft(4, '0') // that will fill your number with 0 on the left, up to 4 length int i = 1; i.toString().PadLeft(4,'0') // will return "0001"