String is immutable.
Meaning is every time you use methods in System.String class, you create a new instance of String class in a memory.
Creating new instances in memory for appending the string is costly and it consumes memory.
The System.Text.StringBuilder is a class which can modify String without creating new instance of string in memory.
protected void Button1_Click(object sender, EventArgs e)
StringBuilder sb = new StringBuilder("This is default constructor string ");
string firstName = " MyName ";
string lastName = " MyLastName ";
Response.Write( sb.ToString() );
This is default constructor string MyName MyLastName
Here sb is only one instance and we are not creating new instances for concatinating the two or many strings.
Also, you can clear the sb by calling Clear method of it