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

 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();
posted @ 2015-04-15 10:05  94cool  阅读(1034)  评论(0编辑  收藏  举报