v1.9.1
Returns the first item of an array.
Input
{{ "Ground control to Major Tom." | split: " " | first }} |
Output
Ground |
Input
{% assign my_array = "zebra, octopus, giraffe, tiger" | split: ", " %} |
Output
|
You can use first with dot notation when you need to use the filter inside a tag:
{% if my_array.first == "zebra" %} |