first取数组的第一项
ZKEASOFT August 28, 2018
first
first
用于返回数组的第一项。
输入
{% assign my_array = "apples, oranges, peaches, plums" | split: ", " %}
{{ my_array.first }}
输出
apples
输入
{% assign my_array = "zebra, octopus, giraffe, tiger" | split: ", " %}
{{ my_array.first }}
输出
zebra