String.PadLeft()

string num=12

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


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

 

原文地址:https://www.cnblogs.com/Yellowshorts/p/2917095.html