constantCase
Rewrites a name or phrase as CONSTANT_CASE.
Details #
constantCase(text) rewrites text as CONSTANT_CASE. It splits the text into words on spaces and punctuation, on a change from lower to upper case, between letters and digits, and where an acronym ends, so parseURL2Fast is the words parse, URL, 2 and Fast.
The same operation is the constantCase op of the Transform text step, so it also appears in Paste As and the clipboard actions.
Parameters #
Takes 1 argument.
{{ constantCase(text) }}
Examples #
constantCase("some name here")→
SOME_NAME_HEREGotchas #
Punctuation is dropped:
constantCase("hello, world")givesHELLO_WORLD.Apostrophes are dropped without splitting a word ("don't" stays one word).