Java tutorial
//package com.java2s; public class Main { public static String first_letter_uppercase(String source) { StringBuffer res = new StringBuffer(); String[] strArr = source.split(" "); for (String str : strArr) { char[] stringArray = str.trim().toCharArray(); stringArray[0] = Character.toUpperCase(stringArray[0]); str = new String(stringArray); res.append(str).append(" "); } return String.valueOf(res); } }