split - Liquid Filter Reference - 1.0.0

Filter Name split
Group Arrays
Version 1.0.0

Description

Divides a string into an array using the argument as a separator. split is commonly used to convert comma-separated items from a string to an array.

Examples

{% assign an_array = "earth, water, air, fire" | split: ", " %}

{% for element in an_array -%}
- {{ element }}
{% endfor %}
- earth
- water
- air
- fire

Back to Filter List

Back to Liquid Reference for 1.0.0

 

 
Back to Documentation