Click here to Skip to main content
15,906,645 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am in a little bit problem.
I want to a string increased by 1 .
lets give a picture.
string a ="00001",
I want when i add by 1 the result should be "00002" not only 2.
Can any one help me.

Thanks
And Merry Christmas..:)
Posted

1 solution

Use String.Format[^]:

C#
String.Format("{0:00000}", 15);


(See also: http://www.csharp-examples.net/string-format-int/[^])
 
Share this answer
 
Comments
Manojit Mondal 25-Dec-12 4:40am    
thanks....
It works.:)
Zoltán Zörgő 25-Dec-12 5:02am    
You are welcome. Than feel free to accept it :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900