You could try:
List<string> a = new List<string>();
List<string> b = new List<string>();
a.AddRange(b);
MSDN page for AddRange
This preserves the order of the lists, but it doesn't remove any duplicates which Union
would do.
This does change list a
. If you wanted to preserve the original lists then you should use Concat
(as pointed out in the other answers):
var newList = a.Concat(b);
This returns an IEnumerable
as long as a
is not null.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…