Is there a function built into Java that capitalizes the first character of each word in a String, and does not affect the others?
Examples:
jon
If you prefer Guava...
String myString = ...; String capWords = Joiner.on(' ').join(Iterables.transform(Splitter.on(' ').omitEmptyStrings().split(myString), new Function() { public String apply(String input) { return Character.toUpperCase(input.charAt(0)) + input.substring(1); } }));