关于字符串不为空 错误: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;
}
}
 

 

posted @ 2018-06-04 15:14  小六子666  阅读(668)  评论(0编辑  收藏  举报