类 StrUtil


  • public class StrUtil
    extends Object
    字符串工具类
    版本:
    2.0.0
    • 构造器详细资料

      • StrUtil

        public StrUtil()
    • 方法详细资料

      • isEmpty

        public static boolean isEmpty​(CharSequence cs)
        为空
        参数:
        cs - 字符串
        返回:
        是否为空
      • isNotEmpty

        public static boolean isNotEmpty​(CharSequence cs)
        不为空
        参数:
        cs - 字符串
        返回:
        是否不为空
      • isBlank

        public static boolean isBlank​(CharSequence cs)
        为null或者空
        参数:
        cs - 字符串
        返回:
        是否为null或空
      • isNotBlank

        public static boolean isNotBlank​(CharSequence cs)
        不为null或者空
        参数:
        cs - 字符串
        返回:
        是否不为null或空
      • trim

        public static String trim​(String str)
        去除前后空格
        参数:
        str - 字符串
        返回:
        字符串
      • trimToNull

        public static String trimToNull​(String str)
        去除空格后长度为0就返回null
        参数:
        str - 字符串
        返回:
        字符串
      • trimToEmpty

        public static String trimToEmpty​(String str)
        去除空格,为null返回空字符串
        参数:
        str - 字符串
        返回:
        字符串
      • cleanupMap

        public static <V> Map<String,​V> cleanupMap​(Map<String,​V> map)
        清除字典中值为空的项。
        类型参数:
        V - 泛型
        参数:
        map - 待清除的字典
        返回:
        清除后的字典
      • fastSimpleUUID

        public static String fastSimpleUUID()
        简化的UUID