Here you can find the source of fieldName(String underScore)
public static String fieldName(String underScore)
//package com.java2s; //License from project: Apache License public class Main { public static String fieldName(String underScore) { StringBuilder name = new StringBuilder(); underScore = underScore.toLowerCase(); boolean isUnderScore = false; for (int i = 0; i < underScore.length(); i++) { char spell = underScore.charAt(i); if (isUnderScore) { name.append(Character.toUpperCase(spell)); isUnderScore = false;//from w w w .j a v a 2s . c o m } else { if (spell == '_') { isUnderScore = true; } else { name.append(spell); } } } return name.toString(); } }