See Also: StringBuilder Members
This class represents string-like objects that are mutable. After a System.Text.StringBuilder object has been created, it can be directly modified by removing, replacing, or inserting characters. This contrasts the string class, which represents an immutable string of characters.
The StringBuilder.Capacity of an instance of the System.Text.StringBuilder class is the maximum number of characters it can hold in the currently allocated space. The System.Text.StringBuilder will dynamically allocate more space when it is required.
Unlike most types in the Base Class Library, the arguments to System.Text.StringBuilder members are assumed to be passed as in / out arguments (passed by reference).
An instance of string is said to be "immutable" because its value cannot be modified once it has been created. Methods on string that appear to modify a string instance actually return a new instance containing the modification. The System.Text.StringBuilder class provides methods that actually modify the contents of a string-like object.
Relational operators only perform reference comparisons (unless overloaded by a particular language compiler). Despite this restriction, relational operators can be used to compare string objects that are assigned literal values. Their values are immutable and can't change, so a reference comparison is sufficient. Because System.Text.StringBuilder instances are mutable, they should not be compared with relational operators.
For performance reasons a System.Text.StringBuilder might allocate more memory than needed. The amount of memory allocated is implementation specific.