Emphasise the Words

Published by Andrew Knapp 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

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

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

emphasise("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.