首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

LINQ的有关问题,待

2012-02-16 
LINQ的问题,在线等待.Liststring[] p new Liststring[](){new string[]{a,b,c},new string[]{

LINQ的问题,在线等待.
List<string[]> p = new List<string[]>()
  {
  new string[]{"a","b","c"},
  new string[]{"1","2","3"}
  };

现在想把p转成下面的s,请问如何做呢?谢谢!

string[] s = new string[] { "a", "b", "c", "1", "2", "3" };

[解决办法]

C# code
    public static class MyExtension    {        public static T[] GetList<T>(IEnumerable<T[]> t)        {            List<T> list = new List<T>();            foreach(T[] arr in t)            {                foreach(T item in arr)                {                    list.Add(item);                }            }            return list.ToArray();        }    } 

热点排行