//字符串转数字 public static void strToInt(String str){ String a = "23423"; char[] arr = a.toCharArray(); int len = arr.length; int inta = 0; for(int i = 0;i < len;i++){ inta = (int) (inta + (((int)arr[i])-48) * (Math.pow(10, len-i-1))); } System.out.println(inta); }