Here you can find the source of underscoreToCamel(String input, boolean firstLetterUppercase)
private static String underscoreToCamel(String input, boolean firstLetterUppercase)
//package com.java2s; //License from project: Apache License public class Main { private static String underscoreToCamel(String input, boolean firstLetterUppercase) { if (input == null) return null; StringBuilder builder = new StringBuilder(); boolean firstFound = false; boolean capitalizeNext = firstLetterUppercase; for (char c : input.toCharArray()) { if (c == '_') { if (firstFound) { capitalizeNext = true; }/*from www.j a va 2 s. c o m*/ } else { firstFound = true; char appendChar = capitalizeNext ? Character.toUpperCase(c) : c; builder.append(appendChar); capitalizeNext = false; } } return builder.toString(); } }