类 StringUtils

java.lang.Object
club.zhcs.lina.utils.StringUtils

public class StringUtils extends Object
作者:
Kerbores(kerbores@riemann.tech)
  • 构造器详细资料

    • StringUtils

      public StringUtils()
  • 方法详细资料

    • change

      public static String change(String str, int n, String sp)
      字符串去除空白字符后从左到右按照一定位数插入字符
      参数:
      str - 源
      n - 位数
      sp - 插入字符
      返回:
      字符串
    • getString

      public static String getString(Object obj)
    • isNullOrEmpty

      public static boolean isNullOrEmpty(Object object)
    • rChange

      public static String rChange(String str, int n, String sp)
      字符串去除空白字符后从右到左按照一定位数插入字符
      参数:
      str - 源
      n - 位数
      sp - 插入字符
      返回:
      字符串
    • sTrim

      public static String sTrim(String in)
      去除全部空白
      参数:
      in - 输入字符串
      返回:
      字符串
    • stringConvertList

      public static List<Integer> stringConvertList(String source)
      将数字格式字符串转换成list
      参数:
      source - 源字符串,格式为1,2,3
      返回:
      数字数组
    • stringConvertList

      public static <T> List<T> stringConvertList(String[] source, Class<T> clazz)
    • reverse

      public static String reverse(String info)
    • stringConvertList

      public static <T> List<T> stringConvertList(String source, Class<T> clazz)
    • replaceTokens

      public static String replaceTokens(String openToken, String closeToken, String text, Object... args)
      替换字符串中的占位符
      参数:
      openToken - 占位符开始标识
      closeToken - 占位符结束标识
      text - 原始文本
      args - 参数
      返回:
      替换结果
    • replaceDollarBraceTokens

      public static String replaceDollarBraceTokens(String text, Object... args)
      替换字符串中的占位符 ${} 形式
      参数:
      text - 原始文本
      args - 参数
      返回:
      替换结果
    • replaceBraceTokens

      public static String replaceBraceTokens(String text, Object... args)
      替换字符串中的占位符 {} 形式
      参数:
      text - 原始文本
      args - 参数
      返回:
      替换结果