码迷,mamicode.com
首页 > Windows程序 > 详细

C# 判断List集合中是否有重复的项

时间:2017-12-22 19:46:43      阅读:529      评论:0      收藏:0      [点我收藏+]

标签:判断   post   div   .net   count   count()   body   pos   nbsp   

/*在.Net 3.5 以上*/
bool HaveDuplicates = vList.GroupBy(i => i).Where(g => g.Count() > 1).Count() >= 1;

 

C# 判断List集合中是否有重复的项

标签:判断   post   div   .net   count   count()   body   pos   nbsp   

原文地址:http://www.cnblogs.com/ouylvr0625/p/8087177.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!