判断一个字符串是否为数字
public boolean isNumber(String str){
try{
new BigDecimal(str);
}catch (Exception e){
return false;
}
return true;
}
判断一个字符串是否为整数
public static boolean isInt(String str) {
try {
Integer.valueOf(str);
} catch (Exception e) {
return false;
}
return true;
}