List of utility methods to do String Camel Case To
String | camelCaseToSeparatorCase(String s, String separator) camel Case To Separator Case char[] input = s.toCharArray(); StringBuilder output = new StringBuilder(); for (int i = 0; i < input.length; i++) { char c = input[i]; if (Character.isLowerCase(c) || isSpecialCharacter(c)) { output.append(c); } else { if (i > 0) { ... |
String | camelCaseToSpacedString(String camel) camel Case To Spaced String StringBuilder result = new StringBuilder(); int i = 0; while (i < camel.length()) { char c = camel.charAt(i); if (Character.isUpperCase(c) && i != 0) { result.append(' '); int initialUpperCaseLetterIndex = i; while (i < camel.length() && Character.isUpperCase(camel.charAt(i))) { ... |
String | camelcaseToUppercase(String camelCase) Converts a name that's given in camel-case into upper-case, inserting underscores before upper-case letters. int n = camelCase.length(); StringBuilder upperCase = new StringBuilder(n * 4 / 3); for (int i = 0; i < n; ++i) { char ch = camelCase.charAt(i); if (Character.isUpperCase(ch)) { upperCase.append('_'); upperCase.append(ch); } else { ... |
String | camelCaseToWords(String data) camel Case To Words final StringBuilder stringBuilder = new StringBuilder(); for (String w : data.split("(?<!(^|[A-Z]))(?=[A-Z])|(?<!^)(?=[A-Z][a-z])")) { stringBuilder.append(w).append(' '); return stringBuilder.toString().trim(); |
String | camelCaseUnderscores(String str) camel Case Underscores StringBuffer buff = new StringBuffer(); boolean capitalize = false; boolean doAppend = false; for (int i = 0; i < str.length(); i++) { char ch = str.charAt(i); if (capitalize) { ch = Character.toUpperCase(ch); doAppend = true; ... |
String | camelHump(String str) camel Hump if (str != null && (str = str.trim()).length() > 0) { str = str.substring(0, 1).toUpperCase() + str.substring(1); return str; |
String[] | camelHumpsToWords(String camelHumps) camel Humps To Words return camelHumpsToWords0(camelHumps, 0, 0);
|
String | camelhumpToUnderline(String str) camelhump To Underline final int size; final char[] chars; final StringBuilder sb = new StringBuilder((size = (chars = str.toCharArray()).length) * 3 / 2 + 1); char c; for (int i = 0; i < size; i++) { c = chars[i]; if (isLowercaseAlpha(c)) { sb.append(toUpperAscii(c)); ... |
String | camelizeOneWord(String word, boolean firstLetterInLowerCase) camelize One Word if (word == null || "".equals(word)) return word; String firstChar = word.substring(0, 1); String result = (firstLetterInLowerCase) ? firstChar.toLowerCase() : firstChar.toUpperCase(); if (word.length() > 1) { result += word.substring(1); return result; ... |
String | camelPrefix(String str, int prefixSize) camel Prefix return prefixSize + 1 >= str.length() ? str : Character.isUpperCase(str.charAt(prefixSize)) ? str.substring(0, prefixSize + 2) + "\u2026" : str.substring(0, prefixSize + 1) + "\u2026"; |