tags:

views:

523

answers:

2

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)?

+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
+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