Java Utililty Methods String Camel Case

List of utility methods to do String Camel Case

Description

The list of methods to do String Camel Case are organized into topic(s).

Method

StringcamelCase(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());
...
StringcamelCase(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;
...
StringcamelCase(String text)
Converts the given String to camel case.
return camelCase(text, ' ');
StringcamelCase(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;
...
StringcamelCase(String text)
Converts the given String to camel case.
return camelCase(text, ' ');
StringcamelCased(String str)
camel Cased
StringBuilder result = new StringBuilder();
for (String part : str.split("\\s+")) {
    result.append(capitalizedFirst(part));
return result.toString();
booleancamelCasedWord(String s)
camel Cased Word
return camelCasedWord(s, 0, s.length());
StringcamelCaseWord(String word)
camel Case Word
return word.substring(0, 1).toUpperCase() + word.substring(1);
Stringcameliza(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]);
...
Stringcameliza(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];
...