Here you can find the source of toCamelCase(String s)
public static String toCamelCase(String s)
//package com.java2s; //License from project: Open Source License public class Main { public static String toCamelCase(String s) { String[] parts = s.split("_"); String camelCaseString = ""; for (String part : parts) { camelCaseString = camelCaseString + toFirstUpperCase(part); }/*w w w. j av a 2s .co m*/ return camelCaseString; } private static String toFirstUpperCase(String s) { return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase(); } }