Boosting the Performance of an ASP.NET Application Using StringBuilder Class
page 4 of 7
by Brett Burridge
Average Rating: 
Views (Total / Last 10 Days): 29327/ 52

Using the StringBuilder class

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


Subsequent text may be concatenated to the text already contained in the class by making further uses of the Append method.

Listing 3


Finally, once all of the concatenations have been performed, the entire text may be accessed using the ToString() method of the class.

Listing 4


Note that the StringBuilder class contains a number of other methods and properties that are beyond the scope of this article.

View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-07-25 11:29:16 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search