Monday, March 22, 2004

ArrayList Method to Array

ArrayList a = new ArrayList();
a.Add(4);
a.Add(5);
a.Add(6);
a.Add(7);
a.Add(8);

int [] arr = new int[a.Count];
int cntr = 0;

arr = (int []) a.ToArray(typeof(int));

foreach ( int n in arr )
{
Console.WriteLine(n.ToString());
}

No comments:

Shared Cache - .Net Caching made easy

All information about Shared Cache is available here: http://www.sharedcache.com/. Its free and easy to use, we provide all sources at codeplex.

Facebook Badge