Emphasize The Words

Published by Deep Xavier in

Create a function that returns a capitalized version of the string passed. The first letter of each word in the string should be capitalized while the rest should be in lowercase.

Examples

emphasize("hello world!") ➞ "Hello World!"

emphasize("GOOD MORNING!") ➞ "Good Morning!"

emphasize("I AM, BUT aLL yOuRs, TESH!")  ➞ "I Am, But All Yours, Tesh!"

emphasize("99 red balloons!") ➞ "99 Red Balloons!"

Notes

  • You won't run into any issues when dealing with numbers in strings.
Watch a quick demo on how Edabit works.