String Management

In your applications you would come across the need for concatenating strings. The best ways will be1. Using the += operator. Use the += operator when the number of appends is known.

ITPro Today

May 24, 2004

1 Min Read
ITPro Today logo in a gray background | ITPro Today

In your applications you would come across the need for concatenating strings.  The best ways will be

1. Using the += operator. Use the += operator when the number of appends is known.

2. String Builder. Use the String Builder object when the number of appends is unknown. Treat StringBuffer as a reusable buffer.

3. Response.Write . Use the Response. Write method. It is one of the fastest ways to return output back to the browser.

Use the following guidelines when you are managing your string

1. Use Response.Write for formatting output.

2. Use StringBuilder for temporary buffers.

3. Use HttpTextWriter when building custom controls.

 

Ref: Improving .NET Performance and Scalability

Http://www.microsoft.com/practices/

 

 

 

 

 

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like