类 Strings


  • public final class Strings
    extends Object
    Created by xiaoxu.yxx on 2014/6/23.
    • 构造器详细资料

      • Strings

        public Strings()
    • 方法详细资料

      • join

        public static String join​(CharSequence... array)
        连接字符串数组,
        参数:
        array -
        返回:
      • join

        public static String join​(Object[] array)
        连接字符串数组,
        返回:
      • join

        public static String join​(Object[] array,
                                  String separator)
        连接字符串数组,
        返回:
      • join

        public static String join​(Object[] array,
                                  char separator)
        连接字符串数组,
        返回:
      • join

        public static String join​(Object[] array,
                                  String separator,
                                  int startIndex,
                                  int endIndex)
        连接字符串数组,
        返回:
      • join

        public static String join​(Object[] array,
                                  char separator,
                                  int startIndex,
                                  int endIndex)
        连接字符串数组,
        返回:
      • join

        public static <T> String join​(Iterable<T> iterable,
                                      String separator)
        连接字符串数组,
        返回:
      • capitalize

        public static String capitalize​(CharSequence s)
        将字符串每个单词首字母大写
        参数:
        s - 字符串
        返回:
        首字母大写后的新字符串
      • lowerFirst

        public static String lowerFirst​(CharSequence s)
        将字符串首字母小写
        参数:
        s - 字符串
        返回:
        首字母小写后的新字符串
      • upperFirst

        public static String upperFirst​(CharSequence s)
        将字符串首字母大写
        参数:
        s -
        返回:
      • equalsIgnoreCase

        public static boolean equalsIgnoreCase​(String s1,
                                               String s2)
        检查两个字符串的忽略大小写后是否相等.
        参数:
        s1 - 字符串A
        s2 - 字符串B
        返回:
        true 如果两个字符串忽略大小写后相等,且两个字符串均不为null
      • equalsIgnoreCase

        public static boolean equalsIgnoreCase​(Object obj,
                                               String str)
      • equals

        public static boolean equals​(CharSequence s1,
                                     CharSequence s2)
        检查两个字符串是否相等.
        参数:
        s1 - 字符串A
        s2 - 字符串B
        返回:
        true 如果两个字符串相等,且两个字符串均不为null
      • startsWithChar

        public static boolean startsWithChar​(CharSequence s,
                                             char c)
        判断字符串是否以特殊字符开头
        参数:
        s - 字符串
        c - 特殊字符
        返回:
        是否以特殊字符开头
      • endsWithChar

        public static boolean endsWithChar​(CharSequence s,
                                           char c)
        判断字符串是否以特殊字符结尾
        参数:
        s - 字符串
        c - 特殊字符
        返回:
        是否以特殊字符结尾
      • isEmpty

        public static boolean isEmpty​(CharSequence... css)
      • isEmpty

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

        public static boolean isNotEmpty​(CharSequence cs)
      • isNotEmpty

        public static boolean isNotEmpty​(CharSequence... css)
      • isBlank

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

        public static boolean isNotBlank​(CharSequence str)
      • trim

        public static String trim​(CharSequence cs)
        去掉字符串前后空白
        参数:
        cs - 字符串
        返回:
        新字符串