字符串格式化

把Int值格式化为right-align定长的字符串:

int i = 40;
string s = i.ToString().PadLeft(3,'0');
//s="040"

 

posted @ 2014-09-21 23:07  liaohua  阅读(116)  评论(0编辑  收藏  举报