LINQ的集合运算
List<int> lstOne = new List<int>() { 1, 55, 223, 25 };
List<int> lstTwo = new List<int>() { 54, 22, 56, 1, 25 };
var Intersect = lstOne.Intersect(lstTwo);//计算lstOne和lstTwo两个集合的交集{1,25}
var Union = lstOne.Union(lstTwo);//计算lstOne和lstTwo两个集合的并集{1,55,223,25,54,22,56}
var Except = lstOne.Except(lstTwo);//计算lstOne与lstTwo的差集{55,223}
Except = lstTwo.Except(lstOne);//计算lstTwo与lstOne的差集{54,22,56}
var repeat = Enumerable.Repeat<int>(110, 10);//生成一个序列,其中包含一个重复的值{110,110,110,110,110,110,110,110,110,110}
var Reverse = lstTwo.Reverse<int>();//反转序列中元素的顺序。{25,1,56,22,54}