Emphasise the Words

Published by Mubashir Hassan 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 of each word should be lowercase.

Examples

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

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

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.