Sets the capacity to the actual number of elements in the SortedList.
[Visual Basic] Overridable Public Sub TrimToSize() [C#] public virtual void TrimToSize(); [C++] public: virtual void TrimToSize(); [JScript] public function TrimToSize();
None.
This method can be overridden by a derived class.
This method can be used to minimize a list's memory overhead if no new elements would be added to the list.
To completely clear all elements in a list, call the Clear method before calling TrimToSize.
SortedList Class | SortedList Members | System.Collections Namespace | Clear | Capacity