I have a List in which I select users from db each time a sql query runs with certain value and selects one user in the time thus I cannot limit identical users in sql.
I have list with:
list[0] = "jerry"
list[1] = "tom"
list[2] = "jerry"
I want any (first or last doesn’t matter in my case) to be removed from the list.
Thanks
LINQ can solve this:
If you want a list type, simply call ToList():
Here’s an example from the MSDN.
EDIT: Non-LINQ Example (using Contains() from the List class):