For my code I need to change a arrayList to a string array.
I did it like this
ArrayList tempList = new ArrayList();
//some code to put strings into the list
stringArray = (string[])tempList.ToArray(typeof(string));
It's the last line I don't get. In the ToArray method you set the type as a string[], so why do you still need the cast?