字符串是否为空工具类

java String判断是否为空

public class StringUtils {
    /**
     * 检测某个字符变量是否为空;<br>
     * 为空的情况,包括:null,空串或只包含可以被 trim() 的字符;
     */
    public static final boolean isEmpty(String value) {
        return (value == null || value.trim().length() == 0);
    }
}

  

posted @ 2019-12-11 11:58  FlyingJiang  阅读(991)  评论(0编辑  收藏  举报