Java String Camel Case camelize(String value)

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

Description

camelize

License

Apache License

Declaration

public static String camelize(String value) 

Method Source Code

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

public class Main {

    public static String camelize(String value) {
        if (value == null) {
            return null;
        }// ww  w  .  j a  v  a2s. com

        String[] tokens = value.split("_");
        StringBuilder camelized = new StringBuilder(value.length());
        for (String token : tokens) {
            for (int i = 0; i < token.length(); i++) {
                if (i == 0) {
                    camelized.append(Character.toUpperCase(token.charAt(i)));
                } else {
                    camelized.append(Character.toLowerCase(token.charAt(i)));
                }
            }
        }
        return camelized.toString();
    }
}

Related

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