Converts a string into dashcase by replacing spaces, underscores, and other non-word characters with hyphens (-). Use it when you need consistent, URL-friendly or identifier-friendly formatting.
-
Convert a product name to dashcase
{{dashcase record.product.name}}Input:
{ "record": { "product": { "name": "a-b-c d_e" } } }Output:
a-b-c-d-e
-
Convert a descriptive field
{{dashcase record.category}}Input:
{ "record": { "category": "New Product Launch 2025" } }Output:
new-product-launch-2025
-
Split case-boundary
{{dashcase record.camel}}Input
{ "record": { "camel": "getUserProfile" } }Output
get-user-profile
Tip
-
All separators are normalized into a single
-. -
Useful for generating slugs, file names, or identifiers in APIs and URLs.
-
Multiple non-word characters in a row are collapsed into a single dash.
-
Inserts hyphens at camel/Pascal case boundaries and lowercases the final string.
-
Collapses multiple separators to a single hyphen and trims leading/trailing hyphens (result may be empty for inputs made only of separators).
-
Digits are preserved and participate in tokenization (e.g., "
version-2_1-final" →version-2-1-finalor per your tests,version-2-finalwhen there’s spacing). -
Non-string inputs (datatypes such as number or boolean) are converted to strings before processing. Arrays of primitive types (like strings or numbers) are converted into a comma-separated string before processing. If inputs are objects or object arrays, the output will be unusable.