Capitalize Words

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.

Provided solution:


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.




Capitalize Words

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s