Skip to content
Log in

split - Liquid Filter Reference

On this page

Description

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

Property Value
Return Type list
Category text

Examples

```liquid {% assign an_list = “earth,water,air,fire” | split: “,” %}

{% for element in an_list -%} - {{ element }} {% endfor %} ```

Output: - earth\n- water\n- air\n- fire

Was this article helpful?

Was this article helpful?