split将字符串拆分成数组
ZKEASOFT August 28, 2018
split
split
使用参数作为分隔符将输入字符串分成数组。 split
通常用于将逗号分隔的项从字符串转换为数组。
输入
{% assign beatles = "John, Paul, George, Ringo" | split: ", " %}
{% for member in beatles %}
{{ member }}
{% endfor %}
输出
John
Paul
George
Ringo