Java Utililty Methods String Camel Case Format

List of utility methods to do String Camel Case Format

Description

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

Method

StringtoCamelCase(String str)
to Camel Case
if (str == null || str.length() == 0)
    return "";
String[] parts = str.split("_");
String ret = new String();
for (int i = 0; i < parts.length; i++) {
    String part = parts[i];
    if (i == 0)
        ret += part.substring(0, 1).toLowerCase();
...
StringtoCamelCase(String str)
Converts the supplied string to CamelCase by converting the first character to upper case and the rest of the string to lower case.
String firstLetter = str.substring(0, 1);
String rest = str.substring(1);
return firstLetter.toUpperCase() + rest.toLowerCase();
StringtoCamelCase(String str)
to Camel Case
String[] strings = str.toLowerCase().split("_");
for (int i = 0; i < strings.length; i++) {
    strings[i] = capitalize(strings[i]);
return join(strings);
StringtoCamelCase(String str)
to Camel Case
if (isNull(str))
    return str;
String result = str;
String conv = str.replaceAll("\t", " ");
if (conv.indexOf(" ") != -1) {
    String[] words = conv.split(" ");
    if (words.length > 1) {
        result = words[0];
...
StringtoCamelCase(String str)
Converts a string to camel case.
str = str.trim();
StringBuilder builder = new StringBuilder();
boolean shouldUppercase = false;
for (int i = 0; i < str.length(); i++) {
    char currChar = str.charAt(i);
    if (Character.isWhitespace(currChar) || currChar == '_') {
        shouldUppercase = true;
    } else {
...
StringtoCamelCase(String str)
to Camel Case
StringBuilder sb = new StringBuilder();
for (String s : str.split("_")) {
    sb.append(Character.toUpperCase(s.charAt(0)));
    if (s.length() > 1) {
        sb.append(s.substring(1, s.length()).toLowerCase());
return sb.toString();
...
StringtoCamelCase(String str)
Convert a string to CamelCase
String[] wordList = str.toLowerCase().split("_");
String finalStr = "";
for (String word : wordList) {
    finalStr += capitalize(word);
return finalStr;
StringtoCamelCase(String str, boolean firstCapital)
to Camel Case
return changeSeparator(str, -1, true, Boolean.valueOf(firstCapital), null);
StringtoCamelCase(String string)
Converts the string to camelcase.
StringBuffer result = new StringBuffer(string);
while (result.indexOf("_") != -1) { 
    int indexOf = result.indexOf("_"); 
    result.replace(indexOf, indexOf + 2, "" + Character.toUpperCase(result.charAt(indexOf + 1))); 
return result.toString();
StringtoCamelCase(String string)
to Camel Case
StringBuilder result = new StringBuilder();
for (String word : string.split("_", -1)) {
    if (word.length() > 0) {
        if (Character.isDigit(word.charAt(0))) {
            result.append("_");
        result.append(word.substring(0, 1).toUpperCase());
        result.append(word.substring(1).toLowerCase());
...