DecimalFormat decimalFormat=new DecimalFormat("000");// 字符串數字的位數 String code="aaa001"; // 字符串 String codenew=code.substring(3, code.length()); // 截取字符中的數字 int i=Integer.parseInt(codenew)+1; String k=decimalFormat.format(i); System.out.println(k);
DecimalFormat decimalFormat=new DecimalFormat("000");// 字符串數字的位數 String code="aaa001"; // 字符串 String codenew=code.substring(3, code.length()); // 截取字符中的數字 int i=Integer.parseInt(codenew)+1; String k=decimalFormat.format(i); System.out.println(k);
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。