ratty ratty -4 years ago 168
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

Answer Source

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();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download