Here you can find the source of camelCase(final String value, final String delim)
public static String camelCase(final String value, final String delim)
//package com.java2s; //License from project: Apache License public class Main { /**/* w w w . j av a 2s .c o m*/ * converts string to camel case, using the specified string delimeter */ public static String camelCase(final String value, final String delim) { // check for null if (value == null || value.isEmpty()) { return ""; } final StringBuilder result = new StringBuilder(value.length()); final String[] parts = value.split(delim); if (parts != null && parts.length > 0) { boolean mustCapitalize = false; for (final String part : parts) { if (part.length() > 1) { if (mustCapitalize) { result.append(part.substring(0, 1).toUpperCase()); result.append(part.substring(1).toLowerCase()); } else { result.append(part); mustCapitalize = true; } } else { result.append(part); } } } return result.toString(); } }