1.判断字符串不为空和null:
引用:import org.apache.commons.lang3.StringUtils;
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
String s = "";
if (!StringUtils.isEmpty(s)){
System.out.println("不为空");
}