Suggests that the capacity be reduced to the actual number of elements in the list.
This method can be used to suggest a collection's memory overhead be minimized, e.g., if no new elements are expected to be added to the collection.
Note: To reset a list to its initial state, call the List.Clear method before calling List.TrimExcess.
Namespace: System.Collections.Generic
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0