Default value of StringBuilder in C#
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
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP