Checking for duplicates in a List of Objects C#

后端 未结 7 691
隐瞒了意图╮
隐瞒了意图╮ 2020-12-29 20:35

I am looking for a really fast way to check for duplicates in a list of objects.

I was thinking of simply looping through the list and doing a manual comparison th

相关标签:
7条回答
  • 2020-12-29 21:24

    I think this is what you're looking for:

    List<dupeChecke> duplicates = dupeList.GroupBy(x => x)
                                       .SelectMany(g => g.Skip(1));
    
    0 讨论(0)
提交回复
热议问题