vb.net - Compare two string ArrayLists -
i have 2 array lists
dim colors1 = new arraylist colors1.add("blue") colors1.add("red") colors1.add("yellow") colors1.add("green") colors1.add("purple") dim colors2 = new arraylist colors2.add("blue") colors2.add("green") colors2.add("yellow")
i find out colors missing colors2 found in colors1
look @ using except method. "this method returns elements in first not appear in second. not return elements in second not appear in first."
so can put colors 2 first argument , colors1 second.
edit: meant can put colors 1 first , colors 2 second.
edit2: (per sean)
var missingfrom2 = colors1.except(colors2);
Comments
Post a Comment