Skip to main content

split

string | split: string
returns array of string

Splits a string into an array of substrings based on a given separator.

{%- assign title_words = product.handle | split: '-' -%}

{% for word in title_words -%}
{{ word }}
{%- endfor %}

Output

health
potion
Was this page helpful?