自动化立体仓库 - WCS系统
#
lsh
2024-03-21 b9927bd58cdc940069c7640f3cc04a60dd37ef87
src/main/java/com/zy/common/utils/CommonUtils.java
@@ -27,4 +27,28 @@
        }
    }
    public static boolean isNumeric(String str) {
        // 如果字符串为空,直接返回false
        if (str == null || str.length() == 0) {
            return false;
        }
        // 用正则表达式匹配数字
        return str.matches("-?\\d+(\\.\\d+)?");
    }
    public static boolean isBoolean(String str) {
        if (str == null) {
            return false;
        }
        if (str.length() == 4 || str.length() == 5) {
            if (str.equals("true") || str.equals("false")) {
                return true;
            }
        }
        return false;
    }
}