以过滤字符串为例:
List<string> lsTest = new List<string>() { "aaa", "bbb", "ccc", "aaa" }; HashSet<string> hs = new HashSet<string>(lsTest);过滤后的hs中就只包含前三个元素了。
以过滤字符串为例:
List<string> lsTest = new List<string>() { "aaa", "bbb", "ccc", "aaa" }; HashSet<string> hs = new HashSet<string>(lsTest);过滤后的hs中就只包含前三个元素了。