关于字符串不为空 错误:s!=null

错误:s!=null

正确:StringUtils.isNotBlank(s);      

public static boolean isBlank(CharSequence cs) {
int strLen;
if (cs != null && (strLen = cs.length()) != 0) {
for(int i = 0; i < strLen; ++i) {
if (!Character.isWhitespace(cs.charAt(i))) {
return false;
}
}

return true;
} else {
return true;
}
}
 
原文地址:https://www.cnblogs.com/czlovezmt/p/9133459.html