Here you can find the source of capitalizeFirstCharacters(String whole)
public static String capitalizeFirstCharacters(String whole)
//package com.java2s; //License from project: Open Source License public class Main { public static String capitalizeFirstCharacters(String whole) { final StringBuilder result = new StringBuilder(whole.length()); String[] words = whole.split("\\s"); for (int i = 0, l = words.length; i < l; ++i) { if (i > 0) result.append(" "); result.append(Character.toUpperCase(words[i].charAt(0))).append(words[i].substring(1)); }// w w w.j a v a 2s. c o m return result.toString(); } }