/**
* 判断字符串是否为数字
* @param str 输入字符串
* @return 判断结果是返回true 不是返回false
*/
public static boolean isNumeric(String str){Pattern pattern = Pattern.compile("[0-9]*");
if(!StringUtils.isEmpty(str)){
if(str.contains(".")){
String[] strs = str.split("\\.");
if(strs.length==2){
return (pattern.matcher(strs[0]).matches()&&pattern.matcher(strs[1]).matches());
}else{
return false;
}
}else{
return pattern.matcher(str).matches();
}
}else{
return false;
}
}