Here you can find the source of camelCase(String text)
public static String camelCase(String text)
//package com.java2s; //License from project: Open Source License public class Main { public static String camelCase(String text) { StringBuilder sb = new StringBuilder(); boolean nextTitle = false; for (char c : text.toCharArray()) { if (Character.isSpaceChar(c)) nextTitle = true;/*from ww w . j a v a2 s . c o m*/ else if (nextTitle) { c = Character.toTitleCase(c); nextTitle = false; } sb.append(c); } return sb.toString(); } }