Here you can find the source of capitalize(final String value)
public static String capitalize(final String value)
//package com.java2s; //License from project: Apache License public class Main { public static String capitalize(final String value) { String result = ""; boolean capitalize = true; for (final char c : value.toCharArray()) { final boolean isLetter = Character.isLetter(c); if (isLetter) { result += (capitalize || Character.isUpperCase(c)) ? Character.toUpperCase(c) : Character.toLowerCase(c); }//from w ww . j a va 2 s . c o m capitalize = !isLetter; } return result; } }