Skip to content

Bars Specification 0.1.0 — Transform: split

Category: string · Since: 0.1.0

Splits a string into a list of substrings.

Returns a list of substrings separated by delimiter. An empty delimiter splits character-by-character. Because the result is a list, it composes directly with each, join, and contains.

Input coercion: string

Arguments

Name Type Optional Default
delimiter string no

Arity: 1–1

Worked examples

{{ csv | split: "," }}

["a","b","c"]
{{#each csv | split: "," }}{{ this }};{{/each}}

x;y;z;

Full fixture: transforms/transform-split.json