1.从System.String[]转到List<System.String>
List<System.String> List = new List<System.String>();
string[] str={"1","2","3"};
List = new List<System.String>(str);
2.从List<System.String>转到System.String[]
List<System.String> List = new List<System.String>();
List.Add("1");
List.Add("2");
List.Add("3");
System.String[] str = { };
str = List.ToArray();

本文介绍了如何在C#中实现System.String[]与List<System.String>之间的相互转换。具体包括:1) 如何将字符串数组转换为列表;2) 如何将列表转换为字符串数组。这些操作在日常开发中十分常见。
552

被折叠的 条评论
为什么被折叠?



