System.out.println(Strings.isEmpty(null));//true System.out.println(Strings.isEmpty("")); // true System.out.println(Strings.isEmpty(" ")); //false System.out.println(Strings.isEmpty("bob")); //false System.out.println(Strings.isEmpty(" bob "));//false ---------------------------------------------------------------- System.out.println(Strings.isBlank(null)); //true System.out.println(Strings.isBlank(""));//true System.out.println(Strings.isBlank(" "));// true System.out.println(Strings.isBlank("\t \n \f \r"));//true //对于制表符、换行符、换页符和回车符 System.out.println(Strings.isBlank("bob"));//false System.out.println(Strings.isBlank(" bob "));//false System.out.println(Strings.isBlank("\b")); //false //"\b"为单词边界符
参考自csdn博客:https://blog.csdn.net/lazy_cat_go/article/details/105280664