首页 > 其他 > 详细

StringUtils.hasText()

时间:2021-05-10 13:22:15      阅读:23      评论:0      收藏:0      [点我收藏+]

1、org.springframework.util包下的 StringUtils.hasText()
StringUtils.hasText():如果字符序列不为 null 值,并且字符序列的长度大于 0 ,并且不含有空白字符序列,则返回 true

public static void main(String[] args) {
        Boolean a = StringUtils.hasText(null);
        System.out.println(a);//false
        Boolean a1 = StringUtils.hasText("");
        System.out.println(a1);//false
        Boolean a2 = StringUtils.hasText(" ");
        System.out.println(a2);//false
        Boolean a3 = StringUtils.hasText(" ,");
        System.out.println(a3);//true
    }

 

StringUtils.hasText()

原文:https://www.cnblogs.com/wueryuan/p/14750223.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!