var a = new []{"a"};
var b = new []{"b"};
var c = new []{"c"};
是否可以声明/初始化一个通用列表,在一行中提供上面的三个集合?
var l = new List<string>(a); //fine for one
var l2 = new List<string>(new[] { a, b, c }.SelectMany(x => x)); //this will work but its horrible!
var a = new []{"a"};
var b = new []{"b"};
var c = new []{"c"};
是否可以声明/初始化一个通用列表,在一行中提供上面的三个集合?
var l = new List<string>(a); //fine for one
var l2 = new List<string>(new[] { a, b, c }.SelectMany(x => x)); //this will work but its horrible!