split(分解参数)


根据参数传入的分隔符将字符串分解为数组。split 通常被用于将以逗号为分隔符的字符串转换为数组。

输入
{% assign beatles = "John, Paul, George, Ringo" | split: ", " %} {% for member in beatles %} {{ member }} {% endfor %}
输出
John Paul George Ringo
song song
4 个月前
2

扫描下方二维码手机阅读文章

0 0