Here you can find the source of titleCase(String realName)
public static String titleCase(String realName)
//package com.java2s; //License from project: Open Source License public class Main { public static String titleCase(String realName) { String space = " "; String[] names = realName.split(space); StringBuilder b = new StringBuilder(); for (String name : names) { if (name == null || name.isEmpty()) { b.append(space);//from www . j a v a 2 s.c om continue; } b.append(name.substring(0, 1).toUpperCase()).append(name.substring(1).toLowerCase()).append(space); } return b.toString(); } }