comparing two arrays
-
hi, i have two array lists.. first arraylist consists of 1,2,4,6,8; second arraylist consists of 2,6,9,8 now i want to display the matched values from two arraylists and i need the values of second arraylist which are not in first arraylist.. how can i do this in c#
-
hi, i have two array lists.. first arraylist consists of 1,2,4,6,8; second arraylist consists of 2,6,9,8 now i want to display the matched values from two arraylists and i need the values of second arraylist which are not in first arraylist.. how can i do this in c#
-
hi, i have two array lists.. first arraylist consists of 1,2,4,6,8; second arraylist consists of 2,6,9,8 now i want to display the matched values from two arraylists and i need the values of second arraylist which are not in first arraylist.. how can i do this in c#
Easily... Take Jamie's advice. Post some code that illustrates you can put forth some effort in finding the solution yourself. Until you post code that appears to be close to working (or that we feel was typed in a good-faith effort to solve the problem), and with specific problems/questions, we will not help. -Jeff
-
hi, i have two array lists.. first arraylist consists of 1,2,4,6,8; second arraylist consists of 2,6,9,8 now i want to display the matched values from two arraylists and i need the values of second arraylist which are not in first arraylist.. how can i do this in c#
-
First sort the lists, then you can loop through them side by side and compare the items to find out where they match and where there are items that exist in only one of the lists.
Experience is the sum of all the mistakes you have done.
Guffa wrote:
First sort the lists, then you can loop through them side by side
He can loop through the first ArrayList and use the .Contains(object item) method for the second array list and not interate through both ArrayLists. just a thought