Write a function that accepts a string. The function should capitalize the first letter of each word in the string then return the capitalized string. Use functions and methods where needed.
You can code this with any language of your choice!
Examples
capitalize('a short sentence') ------> 'A Short Sentence'
capitalize('a lazy fox') ------> 'A Lazy Fox'
capitalize('look, it is working!' -------> 'Look, It Is Working'
Directions
Write a function that accepts a string. The function should capitalize the first letter of each word in the string then return the capitalized string. Use functions and methods where needed.
You can code this with any language of your choice!
Examples
capitalize('a short sentence') ------> 'A Short Sentence' capitalize('a lazy fox') ------> 'A Lazy Fox' capitalize('look, it is working!' -------> 'Look, It Is Working'