- The concatenation operators allow multiple input sequences of the same type to be concatenated into a single output sequence.
- Example
string[] FirstSeq = { "Adams",
"Arthur",
};
string[] SecondSeq = {"Buchanan",
"Bush", };
IEnumerable<string> sequence = FirstSeq.Concat(SecondSeq) ;
foreach (var item in sequence)
Console.WriteLine(item);
Console.ReadLine();
//Output
Adams
Arthur
Buchanan
Bush
"Arthur",
};
string[] SecondSeq = {"Buchanan",
"Bush", };
IEnumerable<string> sequence = FirstSeq.Concat(SecondSeq) ;
foreach (var item in sequence)
Console.WriteLine(item);
Console.ReadLine();
//Output
Adams
Arthur
Buchanan
Bush
No comments:
Post a Comment