List<Person> PList = new List<Person>(); PList.Add(new Person{ Name = "Bob", email = " Bob.b@blah.org " });
It basically contains duplicate lines from a file
What I'm trying to understand is how to delete everything until there is only one instance of each in the list.
My initial thought was to use a for loop to start and delete based on comparisons
for (int i = 0; i < List.length; i++) { if (PList.position(i).name == PList.position(i++).name) if (PList.position(i).date is < PList.position(i++).date) "Then I will delete number 1" }
However, I am wondering if there is a better or easier way to do this?
source share