Here you can find the source of camelCaseUnderscores(String str)
public static String camelCaseUnderscores(String str)
//package com.java2s; //License from project: Apache License public class Main { public static String camelCaseUnderscores(String str) { StringBuffer buff = new StringBuffer(); boolean capitalize = false; boolean doAppend = false; for (int i = 0; i < str.length(); i++) { char ch = str.charAt(i); if (capitalize) { ch = Character.toUpperCase(ch); doAppend = true;/* w w w. ja v a2 s . com*/ } if (ch == '_') { capitalize = true; doAppend = false; } else { capitalize = false; doAppend = true; } if (doAppend) { buff.append(ch); } } return buff.toString(); } }