I have a generic list of objects in C#, and wish to clone the list. The items within the list are cloneable, but there doesn\'t seem to be an option to do list.Clone()
list.Clone()
If you only care about value types...
And you know the type:
List newList = new List(oldList);
If you don't know the type before, you'll need a helper function:
List Clone(IEnumerable oldList) { return newList = new List(oldList); }
The just:
List myNewList = Clone(myOldList);