如何使用 C# 删除字符串中的前导零?
例如在下面的数字中,我想删除所有前导零。
0001234
0000001234
00001234
最佳答案
这是您需要的代码:
string strInput = "0001234";
strInput = strInput.TrimStart('0');
关于c# - 如何使用 C# 删除前导零,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7010702/