Capitalize the Last Letter

Published by Matt in

Create a function that capitalizes the last letter of every word.

Examples

cap_last("hello") ➞ "hellO"

cap_last("My Name Is Edabit") ➞ "MY NamE IS EdabiT"

cap_last("HELp THe LASt LETTERs CAPITALISe") ➞ "HELP THE LAST LETTERS CAPITALISE"

Notes

There won't be any cases of punctuation in the tests.

Watch a quick demo on how Edabit works.