Assume two lists, A and B so that A = (1,2,3) and B = (4,5,6). Will A.Concat(B) preserve the order so that the result is (1,2,3,4,5,6)?
views:
523answers:
2
+6
A:
Yes. IEnumerable.Concat will simply turn two list into a single list by attaching one to the end of the other. Order within each list will be preserved.
JaredPar
2009-02-03 15:18:09
+1
A:
Yes, that's pretty much what concatenation means.
Obligatory MSDN quote: (Enumerable.Concat)
Return Value
Type: System.Collections.Generic.IEnumerable(TSource)
An IEnumerable(T) that contains the concatenated elements of the two input sequences.
DrJokepu
2009-02-03 15:19:54