Converting an ArrayList to a String[] Array

ArrayList fileArrayList = new ArrayList();

//Populate fileArrayList

...

string[] files = fileArrayList.ToArray( typeof( string ) ) as string[];

I prefer the as command versus the old style boxing methods.

Comments

Popular Posts