|
|
@@ -115,6 +115,11 @@ public class YamlUtils { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static boolean isNumeric(String str) { |
|
|
public static boolean isNumeric(String str) { |
|
|
return str.matches("-?\\\\d+(\\\\.\\\\d+)?"); // 匹配整数或小数,包括负数 |
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
double num = Double.parseDouble(str); |
|
|
|
|
|
return true; |
|
|
|
|
|
} catch (NumberFormatException e) { |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |