C# 实现数字字符串左补齐0的两种方法 string sss = string.Format("{0:d8}", 500); MessageBox.Show(sss); return; 代码如上,自动补齐前面的0