Code to convert arraylist to array using C#

Karthikanbarasan
Posted by Karthikanbarasan under C# category on | Points: 40 | Views : 4475
ArrayList arrayList= new ArrayList();
int []arrayval = new int[]{};

arrayList.Add(1);
arrayList.Add(2);
arrayList.Add(3);
arrayList.Add(4);
arrayval = (int[])arrayList.ToArray(typeof(Int32));

Comments or Responses

Login to post response