package com.huimv.acquisition.socket.eartagrecive.util;

/**
 * @Author Anchor
 * @Date 2021/7/30 13:17
 * @Version 1.0.1
 */
public class StringUtilsWork {


    public static boolean isEmpty(String str) {
        return str == null || str.length() == 0;
    }

    public static boolean isNotEmpty(String str) {
        return !isEmpty(str);
    }

    public static boolean isBlank(String str) {
        int strLen;
        if (str != null && (strLen = str.length()) != 0) {
            for(int i = 0; i < strLen; ++i) {
                if (!Character.isWhitespace(str.charAt(i))) {
                    return false;
                }
            }

            return true;
        } else {
            return true;
        }
    }

    public static boolean isNotBlank(String str) {
        return !isBlank(str);
    }

    public static void main(String[] args) {


        String a =null;
        String b ="";

        System.out.println(isBlank(a));
        System.out.println(isBlank(b));

        System.out.println(isNotBlank(a));

        System.out.println(isNotBlank(b));

    }




}





