Method TrimExcess TrimExcess() Sets the capacity of the set to the actual number of items it contains, rounded up to a nearby, implementation-specific value. Declaration public void TrimExcess()