Here you can find the source of toCamelCaseCapitalize(String underLineName)
public static String toCamelCaseCapitalize(String underLineName)
//package com.java2s; public class Main { private static final char SEPARATOR = '_'; public static String toCamelCaseCapitalize(String underLineName) { if (underLineName == null) { return null; }/* w w w . ja va 2s. c om*/ underLineName = toCamelCase(underLineName); return underLineName.substring(0, 1).toUpperCase() + underLineName.substring(1); } public static String toCamelCase(String underLineName) { if (underLineName == null) { return null; } underLineName = underLineName.toLowerCase(); StringBuilder sb = new StringBuilder(underLineName.length()); boolean upperCase = false; for (int i = 0; i < underLineName.length(); i++) { char c = underLineName.charAt(i); if (c == SEPARATOR) { upperCase = true; } else if (upperCase) { sb.append(Character.toUpperCase(c)); upperCase = false; } else { sb.append(c); } } return sb.toString(); } }