How to convert ArrayList into string array(string[]) in c#

后端 未结 7 736
无人及你
无人及你 2021-01-03 21:31

How can I convert ArrayList into string[] in C#?

7条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-03 21:55

    A simple Google or search on MSDN would have done it. Here:

    ArrayList myAL = new ArrayList(); 
    
    // Add stuff to the ArrayList.
    String[] myArr = (String[]) myAL.ToArray( typeof( string ) );
    

提交回复
热议问题