请提供C#.net中嵌套列表的示例
如何将列表添加到另一个列表中,例如:请提供C#.net中嵌套列表的示例,c#,list,nested-lists,C#,List,Nested Lists,如何将列表添加到另一个列表中,例如: List<string> list = new List<string>(); List List=新列表(); 我想将此列表添加到另一个列表中,例如: List<List> list2 = new List<List>() List list2=新列表() var list1=new List(); var list2=新列表(); var parentList=新列表{list1,list2}; 创建
List<string> list = new List<string>();
List List=新列表();
我想将此列表添加到另一个列表中,例如:
List<List> list2 = new List<List>()
List list2=新列表()
var list1=new List();
var list2=新列表();
var parentList=新列表{list1,list2};
创建嵌套类,并在每个类中创建一个类型为List的属性(属于xx子类xx)
vb示例如下:
class list1
property list as new List(of xfirstlist)
class xfirstlist
property list2 as new list(of xSecondList)
class xSecondList
end class
end class
end class
所有这些都不会被编辑。编辑问题是在编辑的过程中进行的。它一定会编译的。您可能需要
使用System.Collections.Generic
您所说的“动态”是什么意思?
class list1
property list as new List(of xfirstlist)
class xfirstlist
property list2 as new list(of xSecondList)
class xSecondList
end class
end class
end class