标签:str ati compile 转换 lse att pre 返回 判断字符串
public static boolean isNumericInt(String str){
Pattern pattern = Pattern.compile("[0-9]*");
return pattern.matcher(str).matches();
}
public static boolean isNumeric(String str){
Pattern pattern = Pattern.compile("[0-9]*\\.?[0-9]+");
Matcher isNum = pattern.matcher(str);
if (!isNum.matches()) {
return false;
}
return true;
}
标签:str ati compile 转换 lse att pre 返回 判断字符串
原文地址:https://www.cnblogs.com/lychngdesign/p/12935033.html