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

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

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

7条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-03 21:40

    You can use CopyTo method of ArrayList object.

    Let's say that we have an arraylist, which has String Type as Elements.

    strArrayList.CopyTo(strArray)
    

提交回复
热议问题