Adding an Array to an Array List

  • Thread starter Thread starter Jack Addington
  • Start date Start date
J

Jack Addington

Is it possible to add an array to an ArrayList with one call? Instead of
iterating through each of the array's members and doing an ArrayList.Add( )
?

thanks
 
ArrayList.AddRange()

Is it possible to add an array to an ArrayList with one call? Instead of
iterating through each of the array's members and doing an ArrayList.Add( )
?

thanks
 
System.Collections.ArrayList a = new ArrayList();

string[] s = {"a","b","c"};

a.AddRange(s);

foreach (object o in a.ToArray())

{

System.Diagnostics.Debug.WriteLine(o.ToString());

}
 
Back
Top