泛型集合问题! List<string> monthTemp = new List<string>();我想要创建 二维的 的 该如何创建? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你想象的“二维”是什么定义?List<List<string>>? List<string[]> list = new List<string[]>(); List<List<string>> list = new List<List<string>>();都能实现二维 dictionary<key,value> _dic=new dictionary<key,value>(); List<List<string>> list = new List<List<string>>();list[外层索引][内层索引] 楼主的思想很活跃但一般不只用一个LIST,多维就多个LIST。4楼的说得很对 List<String[]> list = new List<String[]>(); String [] strArr1 = new String[] { "one","two","three"}; list.Add(strArr1); String[] strArr2 = new String[] { "A", "B", "C", "D" }; list.Add(strArr2); for (Int32 i = 0; i < list.Count; i++) { for (Int32 j = 0; j < list[i].Length; j++) { Console.WriteLine(list[i][j]); } } List<List<string>> list = new List<List<string>>(); List<string> stringList1 = new List<string>(); List<string> stringList2 = new List<string>(); stringList1.Add("a"); stringList1.Add("b"); stringList1.Add("c"); list.Add(stringList1); stringList2.Add("e"); stringList2.Add("f"); stringList2.Add("g"); list.Add(stringList2); foreach (List<string> strl in list) { foreach (string s in strl) { Console.Write(s + " "); } Console.WriteLine(); } Console.ReadKey(); List<List<String>> list = new List<List<String>>(); List<String> subList1 = new List<String>(); List<String> subList2 = new List<String>(); subList1.Add("One"); subList1.Add("Two"); subList1.Add("Three"); subList2.Add("A"); subList2.Add("B"); subList2.Add("C"); subList2.Add("D"); list.Add(subList1); list.Add(subList2); for (Int32 i = 0; i < list.Count; i++) { for (Int32 j = 0; j < list[i].Count; j++) { Console.WriteLine(list[i][j]); } } winfrom子窗子可不可以透明??? 有用过Graphics Server.Net控件的么,有个坐标的问题 怎样计算dataread的数据总数 请教各位关于c#Timer的问题(问题描述应该很详细了,代码很简单,结果很费解)!!!!! 看看我写的socket有没有错误???????????? 字符串 关于DataList的一个问题 高分求助 C# 截取字符串,第一位开始直至出现第一个空格 出错阿! 较大数量信息查询时,出现“网页无法显示”问题,也没有错误提示 winform c1FlexGrid dataset表中删除一行~怎么用DataAdapter来更新数据库?
List<string[]> list = new List<string[]>();
List<List<string>> list = new List<List<string>>();都能实现二维
list[外层索引][内层索引]
List<String[]> list = new List<String[]>(); String [] strArr1 = new String[] { "one","two","three"};
list.Add(strArr1);
String[] strArr2 = new String[] { "A", "B", "C", "D" };
list.Add(strArr2); for (Int32 i = 0; i < list.Count; i++)
{
for (Int32 j = 0; j < list[i].Length; j++)
{
Console.WriteLine(list[i][j]);
}
}
List<List<string>> list = new List<List<string>>();
List<string> stringList1 = new List<string>();
List<string> stringList2 = new List<string>();
stringList1.Add("a");
stringList1.Add("b");
stringList1.Add("c");
list.Add(stringList1); stringList2.Add("e");
stringList2.Add("f");
stringList2.Add("g");
list.Add(stringList2); foreach (List<string> strl in list)
{
foreach (string s in strl)
{
Console.Write(s + " ");
}
Console.WriteLine();
}
Console.ReadKey();
List<String> subList2 = new List<String>();
subList1.Add("One");
subList1.Add("Two");
subList1.Add("Three"); subList2.Add("A");
subList2.Add("B");
subList2.Add("C");
subList2.Add("D"); list.Add(subList1);
list.Add(subList2); for (Int32 i = 0; i < list.Count; i++)
{
for (Int32 j = 0; j < list[i].Count; j++)
{
Console.WriteLine(list[i][j]);
}
}