String.PadLeft()

string num=12

num.PadLeft(4, '0'); //结果为为 '0012'


看字符串长度是否满足4位,不满足则在字符串左边以"0"补足

 

posted @ 2013-02-19 14:59  yellowshorts  阅读(5333)  评论(0编辑  收藏  举报