List<int> list = new List<int>();
list.Add(5);
list.Add(2);
list.Add(1);
list.Add(1);
HashSet<int> hs = new HashSet<int>(list);
list = new List<int>(hs);
本文展示如何使用C#中的List和HashSet进行数据去重操作,通过实例代码演示了将重复元素去除的过程。
List<int> list = new List<int>();
list.Add(5);
list.Add(2);
list.Add(1);
list.Add(1);
HashSet<int> hs = new HashSet<int>(list);
list = new List<int>(hs);
1101
4904
1541
809
463

被折叠的 条评论
为什么被折叠?