首页 > 编程语言 > 详细

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

时间:2017-03-09 18:11:47      阅读:151      评论:0      收藏:0      [点我收藏+]
 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;
        }

 

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

原文:http://www.cnblogs.com/myblogslh/p/6526919.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!