Here you can find the source of capitalizeFully(String text)
static public String capitalizeFully(String text)
//package com.java2s; //License from project: Open Source License public class Main { static public String capitalizeFully(String text) { String[] split = text.split(" "); for (int i = 0; i < split.length; ++i) { char[] chars = split[i].toCharArray(); chars[0] = Character.toUpperCase(chars[0]); split[i] = new String(chars); }/*from ww w . j ava2 s . c om*/ return implode(split, " "); } public static String implode(String[] strings) { return implode(strings, ""); } public static String implode(String[] strings, String glue) { String output = ""; if (strings.length > 0) { StringBuilder sb = new StringBuilder(); sb.append(strings[0]); for (int i = 1; i < strings.length; i++) { sb.append(glue); sb.append(strings); } output = sb.toString(); } return output; } }