2种方法实现数字字符串的左补齐0

int temp = 1110;
Console.WriteLine(temp.ToString().PadLeft(6, '0'));  //001110
Console.WriteLine(string.Format("{0:d6}", temp));      //001110

原文地址:https://www.cnblogs.com/baoku/p/4877062.html