Here you can find the source of castUnderLine(String origin)
private static String castUnderLine(String origin)
//package com.java2s; //License from project: Apache License public class Main { private static String castUnderLine(String origin) { String sa[] = origin.split("[_]"); StringBuffer sb = new StringBuffer(); for (int i = 0; i < sa.length; i++) { String s = firstUpper(sa[i]); sb.append(s);/*from w ww . j a v a 2 s .com*/ } return sb.toString(); } public static String firstUpper(String s) { if (s.length() == 0) return ""; char ch[]; ch = s.toLowerCase().toCharArray(); ch[0] = (char) (ch[0] - 32); String result = new String(ch); return result; } }