split - Liquid Filter Reference - 0.10.11

Filter Name split
Group Arrays
Version 0.10.11

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 0.10.11

 

 
Back to Documentation