Distinctapp
去重
Returns distinct values from a collection.spa
Except code
取差集
Returns the difference between two sequences, which means the elements of one collection that do not appear in the second collection.blog
IList<string> strList1 =newList<string>(){"One","Two","Three","Four","Five"};
IList<string> strList2 =newList<string>(){"Four","Five","Six","Seven","Eight"};
var result = strList1.Except(strList2);
foreach(string str in result)
Console.WriteLine(str);
Results:
One
Two
Three
Intersectelement
取並集
Returns the intersection of two sequences, which means elements that appear in both the collections.string
Union it
取交集
Returns unique elements from two sequences, which means unique elements that appear in either of the two sequences.io