程序包 cool.scx.util

类 CaseUtils

java.lang.Object
cool.scx.util.CaseUtils

public final class CaseUtils extends Object
命名方法转换工具类
提供 驼峰 匈牙利 短横线 及 蛇形命名法的互相转换
版本:
0.0.1
作者:
scx567888
  • 构造器详细资料

    • CaseUtils

      public CaseUtils()
  • 方法详细资料

    • toCamel

      public static String toCamel(String str)
      转换为驼峰命名法 getNameByAge
      参数:
      str - s
      返回:
      r
    • toPascal

      public static String toPascal(String str)
      转换为匈牙利命名法 GetNameByAge
      参数:
      str - s
      返回:
      r
    • toKebab

      public static String toKebab(String str)
      转换为短横线命名法 get-name-by-age
      参数:
      str - s
      返回:
      r
    • toSnake

      public static String toSnake(String str)
      转换为蛇形命名法 get_name_by_age
      参数:
      str - s
      返回:
      r
    • toCamel

      public static String toCamel(String str, CaseType caseType)
      转换为驼峰命名法 getNameByAge
      参数:
      str - s
      caseType - a CaseType object
      返回:
      r
    • toPascal

      public static String toPascal(String str, CaseType caseType)
      转换为匈牙利命名法 GetNameByAge
      参数:
      str - s
      caseType - a CaseType object
      返回:
      r
    • toKebab

      public static String toKebab(String str, CaseType caseType)
      转换为短横线命名法 get-name-by-age
      参数:
      str - s
      caseType - a CaseType object
      返回:
      r
    • toSnake

      public static String toSnake(String str, CaseType caseType)
      转换为蛇形命名法 get_name_by_age
      参数:
      str - s
      caseType - a CaseType object
      返回:
      r