类 StringUtils


  • public class StringUtils
    extends Object
    作者:
    tag
    • 构造器详细资料

      • StringUtils

        public StringUtils()
    • 方法详细资料

      • isBlank

        public static boolean isBlank​(String str)
        判断字符串是否为空(null或空字符串)
        参数:
        str - 字符串
        返回:
        验证结果
      • isNull

        public static boolean isNull​(String str)
        判断字符串是否为null
        参数:
        str - 字符串
        返回:
        验证结果
      • isNotBlank

        public static boolean isNotBlank​(String str)
        判断字符串是否不为空(null或空字符串)
        参数:
        str - 字符串
        返回:
        验证结果
      • isNotNull

        public static boolean isNotNull​(String str)
        判断字符串是否不为null
        参数:
        str - 字符串
        返回:
        验证结果
      • getNewUUID

        public static String getNewUUID()
        获取一个UUID
        返回:
        UUID
      • strTrim

        public static String strTrim​(String str)
        去掉字符串前后空格+验证是否为null
        参数:
        str - 字符串
        返回:
        去掉前后空个的字符串
      • isNumeric

        public static boolean isNumeric​(String str)
        是否为正整数
        参数:
        str - 字符串
        返回:
        验证结果
      • isNumber

        public static boolean isNumber​(String str)
        是否为数字
        参数:
        str - 字符串
        返回:
        验证结果
      • isNumberGtZero

        public static boolean isNumberGtZero​(String str)
        验证是大于0的数(包含小数,不限位数)
        参数:
        str - 字符串
        返回:
        验证结果
      • isNuls

        public static boolean isNuls​(String str)
        匹配是否是nuls 验证是大于0的数(包括小数, 小数点后有效位超过8位则不合法)
        参数:
        str - 字符串
        返回:
        验证结果
      • isNumberGtZeroLimitTwo

        public static boolean isNumberGtZeroLimitTwo​(String str)
        验证是大于0的数(包括小数, 小数点后有效位超过2位则不合法)
        参数:
        str - 字符串
        返回:
        验证结果
      • bytes

        public static byte[] bytes​(String value)
        字符串转为字节数组
        参数:
        value - 字符串
        返回:
        转换得到的字节数组
      • equals

        public static boolean equals​(String one,
                                     String theOther)
        比较两个非空(不是null,不是空串、不是空白)字符串是否"相等"
        参数:
        one - 第一个需要比较的字符串
        theOther - 另一个参与比较的字符串
        返回:
        当 两个字符串 都不为空串 且 内容完全一致 (剔除首尾空白后、大小写也一致)时返回 true
      • equals

        public static boolean equals​(String one,
                                     String theOther,
                                     boolean escapeSpace,
                                     boolean ignoreCase)
        比较两个字符串是否 "相等"
        参数:
        one - 参与比较的第一个字符串
        theOther - 参与比较的另一个字符串
        escapeSpace - 是否需要剔除首尾空白 ( true 表示需要剔除首尾空白,false 表示不剔除 )
        ignoreCase - 是否忽略大小写 ( true 表示忽略大小写 ,false 表示不忽略大小写 )
        返回: