判断是不是数字(java)

来源:互联网 发布:破解监控摄像头软件 编辑:程序博客网 时间:2024/05/24 15:40
public static boolean isNumeric(String str) {  if (str != null) {   try {    str = str.trim();    double d = Double.parseDouble(str);    System.out.println(d);    d = d + 1;    return true;   } catch (NumberFormatException e) {   }  }  return false; }