// 判断String是否是数字,静态方法
public static boolean isNumeric(String str) {
Pattern pattern = Pattern.compile("[0-9]*");
Matcher isNum = pattern.matcher(str);
if (!isNum.matches()) {
return false;
}
return true;
}
// 判断String是否为空
public static boolean isEmpty(String str) {
if(str == null || str.trim().length() == 0) {
return true;
}
return false;
}