Files
liquid/filters/split.md
2015-12-04 19:50:03 -05:00

559 B

title
title
split

The split filter takes on a substring as a parameter. The substring is used as a delimiter to divide a string into an array. You can output different parts of an array using array filters.

Input

{% highlight liquid %}{% raw %} {% assign words = "Hi, how are you today?" | split: ' ' %}

{% for word in words %} {{ word }} {% endfor %} {% endraw %}{% endhighlight %}

Output

{% highlight text %} Hi, how are you today? {% endhighlight %}