C# List集合字段转换为List<string>集合
定义类:
public class Student
{
public string Name{get;set;}
}
定义List集合数据:
List<Student> stuList = new List<Student>();
stuList .add(new Student(){Name="a1"});
stuList .add(new Student(){Name="a2"});
定义接收的List<string> 字符串集合:
List<string> vList = new List<string>();
vList =stuList.Select(t => t.Name).ToArray();