Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: C#
Expertise: Beginner
Apr 25, 2005

An Efficient Method of String Concatenation

A good way to concatenate strings in a loop or when performing multiple concatenations, is to use the StringBuilder class:

String s = "a"
s+="b"; //this is slow

StringBuilder sb = new StringBuilder();
sb.Append("a");
sb.Append("b");
Prasad Haridass
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap