Find and Deletes Duplicates in List of Tuples in C#

后端 未结 4 1371
终归单人心
终归单人心 2021-02-04 01:18

I need to find and remove the duplicates from a List of tuples. Basically, my structure is made like that:

List> myList = new L         


        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-04 01:36

    You can use Distinct() method of LINQ, like this:

    myList = myList.Distinct().ToList();
    

    Note that this would re-create the list, rather than removing the duplicates in place.

提交回复
热议问题