List of utility methods to do String Camel Case To
String | camelToComposite(String camel) camel To Composite StringBuilder sb = new StringBuilder(); for (int i = 0; i < camel.length(); i++) { char ch = camel.charAt(i); if (i > 0 && Character.isUpperCase(ch)) { sb.append('_'); sb.append(ch); } else { sb.append(Character.toUpperCase(ch)); ... |
String | camelToFixedString(String str, String fixed) camel To Fixed String str = trimToEmpty(str); if (isEmpty(str)) { return str; StringBuilder sb = new StringBuilder(); for (int i = 0; i < str.length(); ++i) { char c = str.charAt(i); if (Character.isUpperCase(c)) { ... |
String | camelToLisp(final String pString) Converts the input string from camel-style (Java in-fix) naming convention to Lisp-style naming convention (hyphen delimitted, all lower case). if (pString == null) { throw new IllegalArgumentException("string == null"); if (pString.length() == 0) { return pString; StringBuilder buf = null; int lastPos = 0; ... |
String | camelToLowerSnake(String camel) Converts camel case string (lower or upper/Pascal) to lower snake case, for example 'helloWorld' or 'HelloWorld' -> 'hello_world' or 'HELLO_WORLD'. return camelToSnake(camel, false);
|
String | camelToPeriod(String value) camel To Period return camelToDelimiter(value, "_"); |
String | camelToSplitName(String camelName, String split) camel To Split Name if (camelName == null || camelName.length() == 0) { return camelName; StringBuilder buf = null; for (int i = 0; i < camelName.length(); i++) { char ch = camelName.charAt(i); if (ch >= 'A' && ch <= 'Z') { if (buf == null) { ... |
String | camelToSql(String name) camel To Sql return name.replaceAll("([A-Z])", "_$1").toLowerCase(); |
String | camelToWords(String camel) camel To Words StringBuilder sb = new StringBuilder(); for (char c : camel.toCharArray()) { if (c >= 'A' && c <= 'Z') sb.append(" ").append((char) (c - 'A' + 'a')); else sb.append(c); if (sb.charAt(0) == ' ') ... |
String | camelToXmlCase(String s)CamelCase -> camel-case camelCASE -> camel-case if (s == null) { return null; StringBuilder sb = new StringBuilder(); boolean lastWasLower = false; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (Character.isUpperCase(c)) { ... |
String | camelUp(String name) camel Up return name.substring(0, 1).toUpperCase().concat(name.substring(1));
|