字符串前面自动补零

public class front0add {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        String newString = String.format("%04d",718);   
        System.out.println("newString == "+newString);  
    }

}
原文地址:https://www.cnblogs.com/thiaoqueen/p/6928428.html