学习资源:https://blog.csdn.net/m0_47202681?spm=1001.2014.3001.5343
springframework包下的 StringUtils.hasText()
import org.springframework.util.StringUtils;
public class StringUtilsDemo {
public static void main(String[] args) {
String s1 = null;
String s2 = "";
String s3 = " ";
String s4 = ", ";
// 情况1
if (StringUtils.hasText(s1)) {
System.out.println("s1:" + "\t" + true);
} else {
System.out.println("s1:" + "\t" + false);
}
// 情况2
if