1. 判断是否是数字类型(包括浮点型) public static boolean isInteger(String str) { Pattern pattern = Pattern.compile("^\\d+(\\.\\d+)?"); return pattern.matcher(str).matches(); }