【Java字符串花样操作】自动给某个字符串前面补0

DecimalFormat df = new DecimalFormat("00000000");
id = df.format(1);
例如:
  000001
  000010
要获取这样的数据,后面是累加的数字,当自动补全前面的0

 

posted @ 2022-10-23 11:03  阿迪di  阅读(364)  评论(0编辑  收藏  举报
Title