Java – How to upper case every first letter of word in a string?

javastring

I have a string: "hello good old world" and i want to upper case every first letter of every word, not the whole string with .toUpperCase(). Is there an existing java helper which does the job?

Best Solution

Have a look at ACL WordUtils.

WordUtils.capitalize("your string") == "Your String"