根据参数传入的分隔符将字符串分解为数组。split
通常被用于将以逗号为分隔符的字符串转换为数组。
输入
{% assign beatles = "John, Paul, George, Ringo" | split: ", " %}
{% for member in beatles %}
{{ member }}
{% endfor %}
输出
John
Paul
George
Ringo
© Copyright 2023 深圳蓝晒科技有限公司. 粤ICP备2023054553号-1