当前位置: 代码迷 >> ASP.NET >> List<List<string>> 如何取出里面的string型的值
  详细解决方案

List<List<string>> 如何取出里面的string型的值

热度:3888   发布时间:2013-02-25 00:00:00.0
List<List<string>> 怎么取出里面的string型的值?

List<List<string>> 怎么取出里面的string型的值?

急用谢谢

------解决方案--------------------------------------------------------
C# code
using System;using System.Collections.Generic;namespace ConsoleApplication11{    class Program    {               public static void Main()        {            List<List<string>> l = new List<List<string>>();            List<string> ll = new List<string>();            ll.Add("aa");            ll.Add("bb");            l.Add(ll);            foreach (List<string> lll in l)            {                foreach (string str in lll)                {                    Console.WriteLine(str);                }            }            Console.Read();        }             }}
------解决方案--------------------------------------------------------
up
------解决方案--------------------------------------------------------
实际就是2维数组
------解决方案--------------------------------------------------------
C# code
using System;using System.Collections.Generic;namespace ConsoleApplication11{    class Program    {               public static void Main()        {            List<List<string>> l = new List<List<string>>();            List<string> ll = new List<string>();            ll.Add("aa");            ll.Add("bb");            l.Add(ll);            foreach (List<string> lll in l)            {                foreach (string str in lll)                {                    Console.WriteLine(str);                }            }            Console.Read();        }             }}
------解决方案--------------------------------------------------------
探讨
C# codeusing System;
using System.Collections.Generic;
namespace ConsoleApplication11
{
class Program
{

public static void Main()
{
List<List<string>> l = new List<List<string>>();
List<string> ll = new List<string>();
ll.Add("aa");
ll.Add("bb");
l.Add(ll);
foreach (List<string> …
  相关解决方案