Merging Different Array lists into a Single Array list

//First Add System.Collections Name Space In order to Access Array list Class.
//I have Taken 2 Arraylist i.e., arr,arr1. We can take any no. of Array lists
Array List arr = new Array List();
Array List arr1 = new Array List();
//I have taken another arraylist in which above 2 arraylist items are copied.
ArrayList totarr = new ArrayList();
totarr.AddRange(print(arr, arr1));
//In this method all arraylist items are combined & returned to main where they are added to Arraylist.
static Queue print(params ICollection[] arrayitems)
Queue iq = new Queue();
for (int i=0;i {
IEnumerator allitems = arrayitems[i].GetEnumerator();
while (allitems.MoveNext())
return iq;


No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: