Browse the docs

snakeCase

Rewrites a name or phrase as snake_case.

Details #

snakeCase(text) rewrites text as snake_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 snakeCase op of the Transform text step, so it also appears in Paste As and the clipboard actions.

Parameters #

Takes 1 argument. {{ snakeCase(text) }}

Examples #

snakeCase("parseURL2Fast")
→ parse_url_2_fast

Gotchas #

  • Punctuation is dropped: snakeCase("hello, world") gives hello_world.

  • Apostrophes are dropped without splitting a word ("don't" stays one word).