1:把int转换成前面补0的字符串
String str = String.format("%06",12);//其中0表示补零而不是补空格,6表示至少6位 ,12是int的数值
结果是 12—>000012
1:把int转换成前面补0的字符串
String str = String.format("%06",12);//其中0表示补零而不是补空格,6表示至少6位 ,12是int的数值
结果是 12—>000012
转载于:https://www.cnblogs.com/yuanhailiang/p/10025890.html