isEmpty只判断是否为null和长度是否为0
public static boolean isEmpty(String str) { return str == null || str.length() == 0; }
isBlank判断的是该字符串是否为空白字符串
public static boolean isBlank(String str) { int strLen; if (str != null && (strLen = str.length()) != 0) { for(int i = 0; i < strLen; ++i) { if (!Character.isWhitespace(str.charAt(i))) { return false; } } return true; } else { return true; } }