管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-10-29 34a130282a3ff8fb0b9afdb4e5b986fb5178625f
src/main/java/com/lf/server/helper/StringHelper.java
@@ -15,7 +15,7 @@
    /**
     * 数字正则
     */
    public static final Pattern NUMBER_PATTERN = Pattern.compile("^[-\\+]?[\\d]*[.]?[\\d]*$");
    public static final Pattern NUMBER_PATTERN = Pattern.compile("-?\\d+(\\.\\d+)?");
    /**
     * 格式化当前系统日期 1
@@ -38,10 +38,24 @@
    public static final SimpleDateFormat YMD_HM_FORMAT = new SimpleDateFormat("yyyyMMdd_HHmm");
    /**
     * 判断字符串,是否为数字
     * 判断字符串,是否为整数
     */
    public static boolean isNumber(String str) {
        return NUMBER_PATTERN.matcher(str).matches();
    public static boolean isInteger(String str) {
        return str != null && str.matches("[0-9]+");
    }
    /**
     * 判断字符串,是否为浮点数
     */
    public static boolean isNumeric(String str) {
        return str != null && str.matches("-?\\d+(\\.\\d+)?");
    }
    /**
     * 判断字符串,是否为浮点数
     */
    public static boolean isNumeric2(String str) {
        return str != null && NUMBER_PATTERN.matcher(str).matches();
    }
    /**