Here you can find the source of toCamelCase(String dashCase)
public static String toCamelCase(String dashCase)
//package com.java2s; //License from project: Open Source License public class Main { public static String toCamelCase(String dashCase) { // Split on dash and space String[] parts = dashCase.toLowerCase().split("[- ]+"); StringBuilder builder = new StringBuilder(); // Make the first character upper case for (String part : parts) { if (part.length() > 0) { builder.append(part.substring(0, 1).toUpperCase()); builder.append(part.substring(1)); }/* w ww . j av a 2 s. co m*/ } // First char is lower case if (builder.length() > 0) { String firstChar = builder.substring(0, 1).toLowerCase(); builder.replace(0, 1, firstChar); } return builder.toString(); } }