是否IEnumerable的< TSource> Concat的< TSource> preserve元素的顺序?顺序、元素、TSource、LT

2023-09-04 23:47:10 作者:*谁的等待 恰逢花开

假设两个列表,A和B,使得A =(1,2,3)和B =(4,5,6)。请问A.Concat(B)preserve的顺序,这样的结果是(1,2,3,4,5,6)?

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

推荐答案

是的。 IEnumerable.Concat将简单地把两个列表成一个单一的列表通过附加一个到另一个的末端。令每个列表中将会preserved。

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.