两个int数组对比,返回差异数据

 public static int[] DataDifference(int[] more, int[] few)
        {
            //差异Id
            var sbuNoItapSessionId = new int[more.Length - few.Length];
            var indexi = 0;
            for (int i = 0; i < more.Length; i++)
            {
                var isHave = false;
                for (int j = 0; j < few.Length; j++)
                {
                    if (more[i].Equals(few[j]))
                    {
                        isHave = true;
                        break;
                    }
                }
                if (!isHave)
                {
                    sbuNoItapSessionId[indexi] = more[i];
                    indexi++;
                }
            }
            return sbuNoItapSessionId;
        }
原文地址:https://www.cnblogs.com/myblogslh/p/6526919.html