ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

Clear

clear the contents of a StringBuilder object

Source

public static void Clear(this StringBuilder sb)
{
    sb.Length = 0;
}

Example

StringBuilder sb = new StringBuilder();
//...
sb.Clear();

Author: Manos Aspradakis

Submitted on: 15 jul. 2011

Language: C#

Type: System.Text.StringBuilder

Views: 4978