C# 数字字符串前面不足位补零方法
1 int i = 10;
2 Console.WriteLine(i.ToString("D3"));
3 Console.WriteLine(i.ToString("000"));
4 Console.WriteLine(i.ToString().PadLeft(3,'0'));
MSDN字符串格式相关参考:https://msdn.microsoft.com/zh-cn/library/dwhawy9k.aspx
1 int i = 10;
2 Console.WriteLine(i.ToString("D3"));
3 Console.WriteLine(i.ToString("000"));
4 Console.WriteLine(i.ToString().PadLeft(3,'0'));
MSDN字符串格式相关参考:https://msdn.microsoft.com/zh-cn/library/dwhawy9k.aspx