Write a method that takes in a string of lowercase letters and spaces, producing a new string that capitalizes the first letter of each word.
You’ll want to use the ‘split’ and ‘join’ methods. Also, the String method ‘upcase’, which converts a string to all upper case will be helpful.
My original solution was unnecessarily complicated and didn’t work. 😦
- When using ‘join’, use the original variable that was defined by ‘split’.
- There’s no need to split up the words into letters. Just need to call on the first index of each word and increment to the next word in the sentence.