System.Text.StringBuilder.Clear Method

Removes all characters from the current System.Text.StringBuilder instance.

Syntax

public StringBuilder Clear ()

Returns

An object whose StringBuilder.Length is 0 (zero).

Remarks

StringBuilder.Clear is a convenience method that is equivalent to setting the StringBuilder.Length property of the current instance to 0 (zero).

Calling the StringBuilder.Clear method does not modify the current instance's StringBuilder.Capacity or StringBuilder.MaxCapacity property.

Requirements

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