码迷,mamicode.com
首页 > 其他好文 > 详细

Linq中查询List组合相同值数量大于1

时间:2015-04-15 11:12:28      阅读:109      评论:0      收藏:0      [点我收藏+]

标签:

 List<string> lst = new List<string>();
            lst.Add("1");
            lst.Add("2");
            lst.Add("3");
            lst.Add("1");
            var result = (from n in lst group n by n into g where g.Count() > 1 select g.Key).ToList();

Linq中查询List组合相同值数量大于1

标签:

原文地址:http://www.cnblogs.com/94cool/p/4427736.html

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