I have a customers
List(of String) on which I am trying to find the duplicate customers.
If Not customers.Count = customers.Distinct.ToList.Coun
The VB version:
Dim duplicates = listOfItems.GroupBy(Function(i) i)_
.Where(Function(g) g.Count() > 1)_
.[Select](Function(g) g.Key)
C#:
var duplicates = customers.GroupBy(x => x)
.Where(g => g.Count() > 1)
.Select(g => g.Key);
customers = customers.GroupBy(Function(m) m) _
.Where(Function(g) g.Count() > 1) _
.Select(Function(g) g.Key).ToList