List<string> li1 = new List<string> { "8", "8", "9", "9" ,"0","9"};
HashSet<string> hs = new HashSet<string>(li1); //此时已经去掉重复的数据保存在hashset中
li1=hs.ToList();
List<string> li1 = new List<string> { "8", "8", "9", "9" ,"0","9"};
HashSet<string> hs = new HashSet<string>(li1); //此时已经去掉重复的数据保存在hashset中
li1=hs.ToList();
转载于:https://www.cnblogs.com/lijIT/p/7026159.html