In this article i will show how you can convert a number like 1 to 00001 or add prefix with zero using c#.net. Now here is the tip to perform one liner code to convert 1 to 00001 using c#.net.
int number = 1; string newvalue = String.Format("{0:D6}", number); |
Now here is the output.
Output: 0000001
0 comments:
Please let me know your view