Gets or sets the maximum number of characters that can be contained in the memory allocated by the current instance.
A int containing the maximum number of characters that can be contained in the memory allocated by the current instance.
Type Reason ArgumentException The value specified for a set operation is less than StringBuilder.Length.
The StringBuilder.Capacity property does not affect the string value of the current instance. The System.Text.StringBuilder will dynamically increase the StringBuilder.Capacity and allocate more space when it is required.
Note: For performance reasons a System.Text.StringBuilder might allocate more memory than needed. The amount of memory allocated is implementation specific.
Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0