Capitalize First Letter of Every Word in a String

Is there a good way to capitalize the first letter of every word in a string with the rest lowercase natively in a Mapper or other snap?

For example:
fort worth => Fort Worth
SAN ANTONIO => San Antonio

I see the upperFirst() and capitalize() functions but they only work on the first character in the string, not every word.


Please find the attached simple pipeline:

SL_Test_2020_12_03 (1).slp (3.6 KB)

Hope this helps.

1 Like

Yes that works perfectly! Thank you @Spiro_Taleski