Share via


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)

Syntax

'Declaration
Public Function Clear As StringBuilder
public StringBuilder Clear()
public:
StringBuilder^ Clear()
member Clear : unit -> StringBuilder 
public function Clear() : StringBuilder

Return Value

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

Remarks

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.

.NET Framework Security

See Also

Reference

StringBuilder Class

System.Text Namespace