Here you can find the source of camelCase(String key)
public static String camelCase(String key)
//package com.java2s; //License from project: Apache License public class Main { public static String camelCase(String key) { StringBuilder sb = new StringBuilder(key.length()); boolean upper = true; for (int i = 0; i < key.length(); i++) { char c = key.charAt(i); if (upper) { sb.append(Character.toUpperCase(c)); } else { sb.append(Character.toLowerCase(c)); }/*from ww w. j a va 2 s . c o m*/ upper = c == '-'; } return sb.toString(); } }