Java String Camel Case camelize(String underScore)

Here you can find the source of camelize(String underScore)

Description

camelize

License

Apache License

Declaration

public static String camelize(String underScore) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static String camelize(String underScore) {
        char[] str = underScore.toCharArray();
        for (int i = 0; i < str.length - 1; ++i) {
            if (str[i] == '_') {
                str[i + 1] = toUpperCase(str[i + 1]);
            }/*from   w ww .j  a  v a 2s.  c  o m*/
        }

        return new String(str).replaceAll("_", "");
    }

    public static char toUpperCase(char c) {
        return isLowerCase(c) ? (char) (c - 'a' + 'A') : c;
    }

    public static boolean isLowerCase(char c) {
        if (c <= 'z' && c >= 'a')
            return true;

        return false;
    }
}

Related

  1. camelCasedWord(String s)
  2. camelCaseWord(String word)
  3. cameliza(String str)
  4. cameliza(String str)
  5. camelize(String s)
  6. camelize(String value)
  7. camelize(String value)