鹿我所录的博客

记录我在学习C#中的点点滴滴,记录下以备后来人借鉴。

 

C#中List〈string〉和string[]数组之间的相互转换

1,从System.String[]转到List<System.String>

System.String[] str={"str","string","abc"};

List<System.String> listS=new List<System.String>(str);

 2, 从List<System.String>转到System.String[]

List<System.String> listS=new List<System.String>();

listS.Add("str");

listS.Add("hello");

System.String[] str=listS.ToArray();

详细出处参考:http://www.jb51.net/article/32390.htm

posted on 2014-01-02 20:08  鹿我所录  阅读(280)  评论(0编辑  收藏  举报

导航