/**
* 利用正则表达式判断字符串是否是数字
* @param str
* @return
/
public boolean isNumeric(String str){
if(str != null && str !="") {
Pattern pattern = Pattern.compile("[0-9]");
Matcher isNum = pattern.matcher(str);
if (!isNum.matches()) {
return false;
}
return true;
}else{
return false;
}
}
利用正则表达式判断字符串是否是数字
于 2022-01-11 18:29:02 首次发布