https://blog.csdn.net/wanglui1990/article/details/78552009
需要引入 System.Linq命名空间
C# 两个数组取交集/补集
数组太大时需要不另寻他法
string[] arr1 = new[] { “1”, “2”, “3”, “4”, “5” };
string[] arr2 = new[] { “1”, “3”, “5” };
var sameArr = arr1.Intersect(arr2).ToArray();//找出相同元素(即交集)
var diffArr = arr1.Where(c => !arr2.Contains(c)).ToArray();//找出不同的元素(即交集的补集)