Sets the ArrayList.Capacity of the current instance to the ArrayList.Count of the current instance.
Type Reason NotSupportedException The current instance is read-only or has a fixed size.
Note:This method can be used to minimize the memory overhead of the current instance if no new elements will be added to it.
To completely clear all elements from the current instance, call the ArrayList.Clear method before calling ArrayList.TrimToSize.
Operation
As described above.If the ArrayList.Count of the current instance is zero, the ArrayList.Capacity of the current instance is set to the default initial capacity of 16.
Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0