Windows apps
Collapse the table of content
Expand the table of content

Clear Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Removes all characters from the current StringBuilder instance.

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

public StringBuilder Clear()

Return Value

Type: System.Text..::..StringBuilder
An object whose Length is 0 (zero).

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

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

Show:
© 2017 Microsoft