Removes all characters from the current StringBuilder instance.
using System;
using System.Text;
public class Class1
{
public static void Main()
{
StringBuilder sb = new StringBuilder("This is a string.");
Console.WriteLine("{0} ({1} characters)", sb.ToString(), sb.Length);
sb.Clear();
Console.WriteLine("{0} ({1} characters)", sb.ToString(), sb.Length);
}
}
Related examples in the same category