Here you can find the source of toTitleCase(String s)
public static String toTitleCase(String s)
//package com.java2s; /**// ww w . j a v a2 s . co m * Converts a line of text into an array of lower case words using a * BreakIterator.wordInstance(). * <p> * * This method is under the Jive Open Source Software License and was written * by Mark Imbriaco. * * @param text * a String of text to convert into an array of words * @return text broken up into an array of words. */ public class Main { public static String toTitleCase(String s) { StringBuffer stringbuffer = new StringBuffer(); for (int i = 0; i < s.length(); i++) stringbuffer.append(toTitleCase(s.charAt(i))); return stringbuffer.toString(); } public static char toTitleCase(char c) { return Character.toTitleCase(c); } public static final int length(String baseString) { if (baseString == null) return 0; else return baseString.length(); } }