java中int转成String 位数不足前面补零

来源:http://www.xuebuyuan.com/543811.html

java中int转String位数不够前面补零

String.format("%010d", 25); //25为int型 

0代表前面要补的字符 
10代表字符串长度 
d表示参数为整数类型

猜你喜欢

转载自blog.csdn.net/wangpeng322/article/details/84399446