isEmpty和isBlank区别

org.apache.commons.lang.StringUtils
类提供了String的常用操作,最为常用的判空有如下两种isEmpty(String str)isBlank(String str)

    1、StringUtils.isEmpty(String str) 判断某字符串是否为空,为空的标
       准是str==null 或 str.length()==0;
    2、StringUtils.isBlank(String str) 判断某字符串是否为空或长度为0
       或由空白符(whitespace) 构成;
posted @ 2018-02-26 22:54  大痴小乙  阅读(107)  评论(0)    收藏  举报