Software Bugs and Solutions
Home
Thursday, 31 January 2013
Get duplicate items from a list using LINQ
List
<
String
> duplicates = lst.GroupBy(x => x)
.Where(g => g.Count() > 1)
.Select(g => g.Key)
.ToList();
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment