类 StringUtils

java.lang.Object
cool.scx.common.util.StringUtils

public final class StringUtils extends Object
String工具类
版本:
0.0.1
作者:
scx567888
  • 构造器详细资料

    • StringUtils

      public StringUtils()
  • 方法详细资料

    • repeat

      public static String repeat(String str, String delimiter, int count)
      创建重复字符串 (带分隔符) 拓展了 String.repeat(int) 无法添加分隔符的功能
      参数:
      str - 源字符串
      delimiter - 分隔符
      count - 重复次数
      返回:
      结果
    • notBlank

      public static boolean notBlank(String str)
      校验字符串是否不为 null 且不全为空白 (空格 " ")
      参数:
      str - 待检查的字符串
      返回:
      a boolean.
    • isBlank

      public static boolean isBlank(String str)
      校验字符串是否为 null 或全为空白 (空格 " ")
      参数:
      str - a Object object.
      返回:
      a boolean.
    • notEmpty

      public static boolean notEmpty(String str)
      校验字符串是否不为 null 并且不为空字符串 ("")
      参数:
      str - s
      返回:
      s
    • isEmpty

      public static boolean isEmpty(String str)
      校验字符串是否为 null 或为空字符串 ("")
      参数:
      str - s
      返回:
      s
    • startsWithIgnoreCase

      public static boolean startsWithIgnoreCase(String str, String prefix)
      startsWith (忽略大小写)
      参数:
      str - s
      prefix - s
      返回:
      s
    • endsWithIgnoreCase

      public static boolean endsWithIgnoreCase(String str, String suffix)
      endWith (忽略大小写)
      参数:
      str - s
      suffix - s
      返回:
      s
    • concat

      public static String concat(String... strings)
      联接字符串 但是不连接空
      参数:
      strings - str1
      返回:
      str
    • split

      public static String[] split(String str)
      将字符串拆分为字符 (按照码点拆分, 可正确处理 emoji)
      参数:
      str - 字符串
      返回:
      拆分后的字符数组