Use the default operator to get the default value of StringBuilder.
StringBuilder str = default(StringBuilder);
Above, we have used the default keywords to get the default value.
Let us see the complete code −
Example
using System;
using System.Text;
public class Demo {
public static void Main() {
StringBuilder str = default(StringBuilder);
Console.WriteLine("Default for StringBuilder = "+str);
}
}Output
Default for StringBuilder =
The following is the output. It shows a blank space i.e. Null.
Default for StringBuilder = Null