ratty ratty - 11 months ago 58
C# Question

How do I copy items from list to list without foreach?

How do I transfer the items contained in one

to another in C# without using


You could try this:

List<Int32> copy = new List<Int32>(original);

or if you're using C# 3 and .NET 3.5, with Linq, you can do this:

List<Int32> copy = original.ToList();