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 need a cloned list with the same capacity, you can try this:
public static List Clone(this List oldList) { var newList = new List(oldList.Capacity); newList.AddRange(oldList); return newList; }