根據(jù)參數(shù)傳入的分隔符將字符串分解為數(shù)組。split
?通常被用于將以逗號為分隔符的字符串轉(zhuǎn)換為數(shù)組。
輸入
{% assign beatles = "John, Paul, George, Ringo" | split: ", " %}
{% for member in beatles %}
{{ member }}
{% endfor %}
輸出
John
Paul
George
Ringo
? Copyright 2023 深圳藍(lán)曬科技有限公司. 粵ICP備2023054553號-1