如果我有一个阵列.我可以从该数组填充通用列表:
Foo[] fooList . . . (assume populated array) // This doesn't seem to work ListnewList = new List (fooList);
Andy White.. 26
您可以将数组转换为List:
string[] strings = { "hello", "world" }; IListstringList = strings.ToList();
甚至不需要ToList(),因为数组已经实现了IList
kaivalya.. 9
您正在寻找List(t).AddRange方法
您可以将数组转换为List:
string[] strings = { "hello", "world" }; IListstringList = strings.ToList();
您正在寻找List(t).AddRange方法