uniq删除数组中的重复元素
ZKEASOFT August 28, 2018
uniq
uniq
用于删除数组中的任何重复元素。
输入
{% assign my_array = "ants, bugs, bees, bugs, ants" | split: ", " %}
{{ my_array | uniq | join: ", " }}
输出
ants, bugs, bees
ZKEASOFT August 28, 2018
uniq
用于删除数组中的任何重复元素。
输入
{% assign my_array = "ants, bugs, bees, bugs, ants" | split: ", " %}
{{ my_array | uniq | join: ", " }}
输出
ants, bugs, bees