LINQ 串聯運算符 Concat

Concat()方法附加兩個相同類型的序列,并返回一個新序列(集合)。

IList<string> collection1 = new List<string>() { "One", "Two", "Three" };
IList<string> collection2 = new List<string>() { "Five", "Six"};

var collection3 = collection1.Concat(collection2);

foreach (string str in collection3)
    Console.WriteLine(str);
輸出:
One
Two
Three
Five
Six
IList<int> collection1 = new List<int>() { 1, 2, 3 };
IList<int> collection2 = new List<int>() { 4, 5, 6 };

var collection3 = collection1.Concat(collection2);

foreach (int i in collection3)
    Console.WriteLine(i);
輸出:

1
2
3
4
5
6

C?;騐B.Net中的查詢語法不支持Concat運算符。

丰满人妻一级特黄a大片,午夜无码免费福利一级,欧美亚洲精品在线,国产婷婷成人久久Av免费高清