C# 补零

int id = 16;

Console.WriteLine(id.ToString(
"D5"));
Console.WriteLine(String.Format(
"{0:D5}",id));

Result:
00016
posted @ 2009-09-10 10:33  M'  阅读(563)  评论(0)    收藏  举报