Warm-ups · 23 of 24
Capitalize the first letter of each word
Return the string with the first letter of every word in uppercase and all other letters in lowercase. Words are separated by single spaces.
Examples
Input s = "hello world"
Output "Hello World"
Input s = "jAVA iS fun"
Output "Java Is Fun"
📘 New to this? Building a new string or array as the answer explains the idea in a few minutes.