Removing duplicates from a list collection

后端 未结 4 1948
天命终不由人
天命终不由人 2021-01-21 02:37

Hope someone can help me. I am using c# and I am somewhat new to it. I am loading a text file into my app and splitting the data on \",\" I am reading part of string into a

4条回答
  •  后悔当初
    2021-01-21 03:32

    If you are targeting .NET 3.5, use the Distinct extension method:

    var deduplicated = list.Distinct();
    

提交回复
热议问题