commons-lang3-3.4.jar
时间:2015-10-21 15:33:12
收藏:0
阅读:391
StringUtils
1.StringUtils.isBlank(str); 检查字符串是否为空白(“ ”),为空(“”),为null。
* StringUtils.isBlank(null) = true
* StringUtils.isBlank("") = true
* StringUtils.isBlank(" ") = true
* StringUtils.isBlank("bob") = false
* StringUtils.isBlank(" bob ") = false
public static boolean isBlank(final CharSequence cs) { int strLen; if (cs == null || (strLen = cs.length()) == 0) { return true; } for (int i = 0; i < strLen; i++) { if (Character.isWhitespace(cs.charAt(i)) == false) { return false; } } return true; }
原文:http://www.cnblogs.com/niaomingjian/p/4897701.html
评论(0)