StringUtils.isEmpty()

StringUtils.isEmpty(String str) 

判断某字符串是否为空

为空的标准是 str==null 或 str.length()==0

System.out.println(StringUtils.isEmpty(null));  //true
System.out.println(StringUtils.isEmpty(""));    //true
System.out.println(StringUtils.isEmpty("   ")); //false
System.out.println(StringUtils.isEmpty("测试"));  //false

StringUtils.isNotEmpty(String str) 

等价于 !isEmpty(String str)

StringUtils.isBlank(String str) 

判断某字符串是否为空或长度为0或由空白符构成

System.out.println(StringUtils.isBlank(null));      //true
System.out.println(StringUtils.isBlank(""));        //true
System.out.println(StringUtils.isBlank("   "));     //true
System.out.println(StringUtils.isBlank("测试"));    //false    

StringUtils.isBlank(String str) 

等价于 !isBlank(String str)

原文地址:https://www.cnblogs.com/lin02/p/15707261.html