The StringBuilder class is a member of the System.Text namespace and can be instantiated using the
following code.
Listing 1
Dim NewStringBuilder As New System.Text.StringBuilder
Once an instance of the class has been instantiated, text
may be added to the class by using the Append method, as shown below.
Listing 2
NewStringBuilder.Append("Hello")
Subsequent text may be concatenated to the text already
contained in the class by making further uses of the Append method.
Listing 3
NewStringBuilder.Append("World")
Finally, once all of the concatenations have been performed,
the entire text may be accessed using the ToString() method of the class.
Listing 4
NewStringBuilder.ToString()
Note that the StringBuilder class contains a number of other
methods and properties that are beyond the scope of this article.