问:如何把整数转成有固定长度的字符串? 答:使用下列代码可以输出长度为4的字符串,即生成“0012” int theValue = 12; theValue.ToString("0000"); 相关文章: