标签:java turn cat char except als exce class cte
代码如下:
public static boolean isNum(String num){
return num.matches("(\\s)*([+-])?(([0-9]*\\.)?([0-9]+)|([0-9]+)(\\.[0-9]*)?)([eE][\\+-]?[0-9]+)?(\\s)*");
}
public static boolean isNum(String str){
try {
BigDecimal num = new BigDecimal(str);
}catch (Exception e){//抛异常必定不是数字
return false;
}return true;
}
Character.isDigit(ch)
boolean isLetter(char ch)
标签:java turn cat char except als exce class cte
原文地址:https://www.cnblogs.com/cstdio1/p/12128841.html