两个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;
        }

 

posted @ 2017-03-09 17:54  临冰听雪丶  阅读(616)  评论(0编辑  收藏  举报