Here you can find the source of fieldToProperty(String field)
public static String fieldToProperty(String field)
//package com.java2s; //License from project: Apache License public class Main { public static String fieldToProperty(String field) { if (null == field) { return ""; }//from w ww .j a v a 2 s. com char[] chars = field.toCharArray(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < chars.length; i++) { char c = chars[i]; if (c == '_') { int j = i + 1; if (j < chars.length) { sb.append(String.valueOf(chars[j]).toUpperCase()); i++; } } else { sb.append(c); } } return sb.toString(); } }