ArrayList Delete Both Identical Strings?
-
I have an ArrayList containing data where BOTH identical strings need to be removed. program files\softsoftware\program\help\help3.htm,9/22/2006 2:22 pm program files\softsoftware\program\help\help3.htm,9/22/2006 2:22 pm
If there's not a method to do this, sort them, iterate over them, and delete any that are the same as their neighbour.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
I have an ArrayList containing data where BOTH identical strings need to be removed. program files\softsoftware\program\help\help3.htm,9/22/2006 2:22 pm program files\softsoftware\program\help\help3.htm,9/22/2006 2:22 pm
If you're sure there's only one duplicate you could simply call
ArrayList.Remove
twice.arrayList1.Remove("program files\softsoftware\program\help\help3.htm,9/22/2006 2:22 pm");
arrayList1.Remove("program files\softsoftware\program\help\help3.htm,9/22/2006 2:22 pm");
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook