管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-10-12 b8283ee76c7d02347118c21fcdddabc598143e03
src/main/java/com/lf/server/helper/StringHelper.java
@@ -32,9 +32,6 @@
    /**
     * 判断字符串,是否为数字
     *
     * @param str
     * @return
     */
    public static boolean isNumber(String str) {
        return NUMBER_PATTERN.matcher(str).matches();
@@ -47,9 +44,6 @@
    /**
     * 字符串转为日期
     *
     * @param str
     * @return
     */
    public static Date parseDate(String str) {
        try {
@@ -61,9 +55,6 @@
    /**
     * 字符串转为日期时间
     *
     * @param str
     * @return
     */
    public static Date parseTime(String str) {
        try {
@@ -75,9 +66,6 @@
    /**
     * 判断值是否为日期格式
     *
     * @param strDate
     * @return
     */
    public static boolean isDate(String strDate) {
        Matcher m = datePattern.matcher(strDate);
@@ -86,10 +74,7 @@
    }
    /**
     * 字符串,是否为null或""
     *
     * @param str
     * @return
     * 字符串,是否为null 或 ""
     */
    public static boolean isNull(String str) {
        return null == str || str.length() == 0;
@@ -97,19 +82,20 @@
    /**
     * 字符串,是否为空null和空格
     *
     * @param str
     * @return
     */
    public static boolean isEmpty(String str) {
        return str == null || "".equals(str.trim());
    }
    /**
     * 获取 like 字符串
     */
    public static String getLikeStr(String name) {
        return StringHelper.isEmpty(name) ? null : "%" + name.trim() + "%";
    }
    /**
     * 首字母大写
     *
     * @param str
     * @return
     */
    public static String capitalize(String str) {
        return String.valueOf(str.charAt(0)).toUpperCase() + str.substring(1);
@@ -127,9 +113,6 @@
    /**
     * 字节单位换算
     *
     * @param byteNumber
     * @return
     */
    public static String formatByte(long byteNumber) {
        double kbNumber = byteNumber / D1024;