System.Text.StringBuilder.MaxCapacity Property

Gets the maximum capacity of this instance.

Syntax

public int MaxCapacity { get; }

Value

Documentation for this section has not yet been entered.

Remarks

The maximum capacity for this implementation is int.MaxValue. However, this value is implementation-specific and might be different in other or later implementations.

In the net_v40_short and the net_v45, when you instantiate the System.Text.StringBuilder object by calling the StringBuilder.#ctor(int, int) constructor, both the length and the capacity of the System.Text.StringBuilder instance can grow beyond the value of its StringBuilder.MaxCapacity property. This can occur particularly when you call the StringBuilder.Append(string) and StringBuilder.AppendFormat(string, object) methods to append small strings.

Requirements

Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0