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?
In cell B2, type =PROPER(A2), then press Enter. This formula converts the name in cell A2 from uppercase to proper case. To convert the text to lowercase, type =LOWER(A2) instead. Use =UPPER(A2) in cases where you need to convert text to uppercase, replacing A2 with the appropriate cell reference.
We can capitalize each word of a string by the help of split() and substring() methods. By the help of split("\\s") method, we can get all words in an array. To get the first character, we can use substring() or charAt() method.
Following are the ways: toUpperCase(): This function applies on a string and change the all letters to uppercase. Return Value: This function returns the capitalized string.
Have a look at ACL WordUtils.
WordUtils.capitalize("your string") == "Your String"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With