Here you can find the source of toCamelCase(final String string)
public static String toCamelCase(final String string)
//package com.java2s; public class Main { /**// w w w .j a v a 2 s. c o m * CamelCases a {@link String}. */ public static String toCamelCase(final String string) { if (string == null || string.length() == 0) return string; final StringBuilder builder = new StringBuilder(); boolean upCase = true; for (char ch : string.toCharArray()) { if (Character.isLetterOrDigit(ch)) { builder.append(upCase ? Character.toUpperCase(ch) : Character.toLowerCase(ch)); upCase = false; } else { upCase = true; } } return builder.toString(); } }