import cn.hutool.core.util.StrUtil;
isblank 判断字符串是否为null或者长度为0或者有 制表符、换行符等不可见字符均识别为空
System.out.println(StrUtil.isBlank("")); //true System.out.println(StrUtil.isBlank(null)); //true System.out.println(StrUtil.isBlank(" ")); //true System.out.println(StrUtil.isBlank("\t")); //true System.out.println(StrUtil.isBlank("\n")); //true System.out.println(StrUtil.isBlank("\'")); //false "'"
isempty判断字符串是否为null 或者长度为0,制表符、换行符、空格均这些均识别不为空
System.out.println(StrUtil.isEmpty("")); //true System.out.println(StrUtil.isEmpty(null)); //true System.out.println(StrUtil.isEmpty(" ")); //false System.out.println(StrUtil.isEmpty("\n")); //false