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
Here is a simple function
public static String capEachWord(String source){ String result = ""; String[] splitString = source.split(" "); for(String target : splitString){ result += Character.toUpperCase(target.charAt(0)) + target.substring(1) + " "; } return result.trim(); }