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 from this blog

String.Replace vs Regex.Replace

C# Producer Consumer using Rabbit MQ

C# Form Application in Kiosk Mode/Fullscreen