I have a list but in this list there are lots of elements which have the same value. I want to clear values which have same value and have one of each element group.
If you are using 3.5+ you can use Linq to accomplish that:
myDistinctList = myList.Distinct();
This assumes that the list value is a primitive or an object that implements IComparable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With