我有一个 customers
字符串列表,想要查找其中的重复客户。
If Not customers.Count = customers.Distinct.ToList.Count Then
customers = customers.Except(customers.Distinct.ToList)
End If
但是我遇到了以下异常:
这是在列表中查找重复项的正确方法吗?
InvalidCastException Unable to cast object of type '<ExceptIterator>d__99`1[System.String]' to type
'System.Collections.Generic.List`1[System.String]'.