📜  颤动从列表中删除重复项 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:05.088000             🧑  作者: Mango

代码示例2
List countries = [
    "Nepal", 
    "Nepal", 
    "USA",
    "Canada",
    "Canada",
    "China",
    "Russia",
];

var seen = Set();
List uniquelist = countries.where((country) => seen.add(country)).toList();
print(uniquelist);
//output:  [Nepal, USA, Canada, China, Russia]