Here you can find the source of capitalizeInitials(String words)
static String capitalizeInitials(String words)
//package com.java2s; //License from project: Apache License public class Main { static String capitalizeInitials(String words) { String[] broken = words.split(" "); StringBuilder result = new StringBuilder(); for (String word : broken) { if (result.length() > 0) { result.append(" "); }//ww w. j a v a 2 s .c o m result.append(Character.toUpperCase(word.charAt(0))).append(word.substring(1)); } return result.toString(); } }