join将数组合并为字符串

join将数组合并为字符串

ZKEASOFT August 28, 2018


join

join用于使用参数作为分隔符将数组中的项组合为单个字符串。

输入

{% assign beatles = "John, Paul, George, Ringo" | split: ", " %}

{{ beatles | join: " and " }}

输出

John and Paul and George and Ringo

微信公众号