[C#] 如何把ArrayList轉成string[]

//add a ArrayList myArray
ArrayList myArray = new ArrayList();

//add some value to myArray
myArray.Add(fname);

//using ToArray assing value to new string[] arr 
string[] arr = (string[])myArray.ToArray(Type.GetType(“System.String”));

 

Comments |0|

Legend *) Required fields are marked
**) You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
Category: 來玩C#