首页 > 编程语言 > 详细

Java常用工具类整合

时间:2021-08-09 23:27:35      阅读:20      评论:0      收藏:0      [点我收藏+]

一、字符串相关


StringUtils

  1. isEmpty()    判断字符串是否为空(在cs为null,""的情况下返回true)

        public static boolean isEmpty(final CharSequence cs) {
            return cs == null || cs.length() == 0;
        } 
  2. isBlank()    判断字符串是否为空(在cs为null,"","  "的情况下返回true)
        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))) {
                    return false;
                }
            }
            return true;
        }

     

  3. equals()   判断两个字符串是否为空,

二、IO相关

 

三、集合/数组相关

 

四、日期相关

Java常用工具类整合

原文:https://www.cnblogs.com/passex/p/15120755.html

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