Example strings
one thousand only two hundred twenty seven
How do I change the first character of a string in capital letter and not change
public static String capitalize(String str){ String[] inputWords = str.split(" "); String outputWords = ""; for (String word : inputWords){ if (!word.isEmpty()){ outputWords = outputWords + " "+StringUtils.capitalize(word); } } return outputWords; }