1.使用Character.isDigit(char)判断 char num[] = str.toCharArray();//把字符串转换为字符数组 StringBuffer title = new StringBuffer();//使用StringBuffer类,把非数字放到title中 StringBuffer hire = new StringBuffer();