左边补位
PadLeft
用法:
string str = "100";
str.PadLeft(5,'0')
输出:00100
右边补位
PadRight
str.PadRight(5, '0')
输出:10000
手机扫一扫
移动阅读更方便
你可能感兴趣的文章