Fastest way to Remove Duplicate Value from a list<> by lambda

前端 未结 7 1907
庸人自扰
庸人自扰 2020-12-01 00:55

what is fastest way to remove duplicate values from a list. Assume List longs = new List { 1, 2, 3, 4, 3, 2, 5 }; So I am interesting in

相关标签:
7条回答
  • 2020-12-01 01:24
    List<long> distinctlongs = longs.Distinct().OrderBy(x => x).ToList();
    
    0 讨论(0)
提交回复
热议问题