Here you can find the source of toCamelCase(String input)
public static String toCamelCase(String input)
//package com.java2s; //License from project: Open Source License public class Main { public static String toCamelCase(String input) { String inputLowerCase = input.toLowerCase(); StringBuilder sb = new StringBuilder(); final char delim = '_'; char value; boolean capitalize = false; for (int i = 0; i < inputLowerCase.length(); ++i) { value = inputLowerCase.charAt(i); if (value == delim) { capitalize = true;/* ww w.java 2 s .com*/ } else if (capitalize) { sb.append(Character.toUpperCase(value)); capitalize = false; } else { sb.append(value); } } return sb.toString(); } }