uniq 去除数组中的重复项
去除数组中的所有重复项。
输入
{% assign my_array = "ants, JekyllDo, bugs, bees, bugs, ants, bees, JekyllDo" | split: ", " -%}
{{ my_array | uniq | join: ", " }}
输出
ants, JekyllDo, bugs, bees
去除数组中的所有重复项。
输入
{% assign my_array = "ants, JekyllDo, bugs, bees, bugs, ants, bees, JekyllDo" | split: ", " -%}
{{ my_array | uniq | join: ", " }}
输出
ants, JekyllDo, bugs, bees