Here you can find the source of toCamelCase(String originalName)
static String toCamelCase(String originalName)
//package com.java2s; public class Main { static String toCamelCase(String originalName) { String[] words = originalName.split("-+"); StringBuilder nameBuilder = new StringBuilder(originalName.length()); for (String word : words) { if (nameBuilder.length() == 0) { nameBuilder.append(word); } else { nameBuilder.append(word.substring(0, 1).toUpperCase()); nameBuilder.append(word.substring(1)); }/* w w w.j ava 2s. c om*/ } return nameBuilder.toString(); } }