C#中的加法问题 [英] Addition Problem in C#
本文介绍了C#中的加法问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有点问题。
我希望字符串增加1。
让我们给你一张照片。
字符串a =00001,
我希望当我加1时结果应该是00002而不仅仅是2.
任何人都可以帮助我。
谢谢
圣诞快乐.. :)
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..:)
推荐答案
使用 String.Format [ ^ ]:
Use String.Format[^]:
String.Format("{0:00000}", 15);
(另请参阅: http://www.csharp-examples.net / string-format-int / [ ^ ])
这篇关于C#中的加法问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文