public static boolean isNumeric(String str) {
Boolean isNumber = str.matches("-?[0-9]+.?[0-9]*");
return isNumber;
}
java判断字符串是否为数字包括小数
最新推荐文章于 2023-02-09 08:38:08 发布
public static boolean isNumeric(String str) {
Boolean isNumber = str.matches("-?[0-9]+.?[0-9]*");
return isNumber;
}