List of utility methods to do String Camel Case
String | camelCase(String string, boolean firstUpper) Returns the specified string into "camel case" : each word are appended without white-spaces, but with a capital letter. Note that, except for the first word, if the whole word is uppurcase, it will be converted into lowercase. if (string == null) return null; String value = string.trim().replace('_', ' '); if (value.trim().length() == 0) return value; if (value.equals(value.toUpperCase())) value = value.toLowerCase(); StringBuilder result = new StringBuilder(value.length()); ... |
String | camelCase(String text) Turns a text into camel case. StringBuilder builder = new StringBuilder(); boolean turnIntoUpperCase = false; for (char character : text.toCharArray()) { if (character == ' ') { turnIntoUpperCase = true; } else { builder.append(turnIntoUpperCase ? Character.toUpperCase(character) : character); turnIntoUpperCase = false; ... |
String | camelCase(String text) Converts the given String to camel case. return camelCase(text, ' '); |
String | camelCase(String text) camel Case StringBuilder sb = new StringBuilder(); boolean nextTitle = false; for (char c : text.toCharArray()) { if (Character.isSpaceChar(c)) nextTitle = true; else if (nextTitle) { c = Character.toTitleCase(c); nextTitle = false; ... |
String | camelCase(String text) Converts the given String to camel case. return camelCase(text, ' '); |
String | camelCased(String str) camel Cased StringBuilder result = new StringBuilder(); for (String part : str.split("\\s+")) { result.append(capitalizedFirst(part)); return result.toString(); |
boolean | camelCasedWord(String s) camel Cased Word return camelCasedWord(s, 0, s.length());
|
String | camelCaseWord(String word) camel Case Word return word.substring(0, 1).toUpperCase() + word.substring(1);
|
String | cameliza(String str) cameliza char[] strCharArray = str.toCharArray(); int nroEspacos = conta(' ', str); char[] strCamelizada = new char[strCharArray.length - nroEspacos]; for (int i = 0, j = 0; i < strCharArray.length; i++) { if (strCharArray[i] != ' ') { strCamelizada[j++] = minuscula(strCharArray[i]); } else { strCamelizada[j++] = maiuscula(strCharArray[++i]); ... |
String | cameliza(String str) cameliza char[] strCharArray = str.toCharArray(); int nroEspacos = 0; for (int i = 0; i < strCharArray.length; i++) { if (strCharArray[i] == ' ') { nroEspacos++; char[] strCamelizada = new char[strCharArray.length - nroEspacos]; ... |