The String class in .NET is extremely powerful, and quite useful, but there are times when you want to avoid it. A good reason to steer clear of the String class is when you're manipulating a large number of strings. Instead of doing the usual concatenation of String objects, it's better to use the StringBuilder class.
Differences of String and StringBuilder
The string is an immutable data type, which means that once a string object is created, it cannot be changed. So when you're concatenating a string, you're really allocating memory for a whole new string instance. On the other hand, StringBuilder will allocate more memory for your string then is needed. All string modifications using the StringBuilder class, will take place in this block of memory, which results in better efficiency.
String VS. StringBuilder Example
Sure, all this efficiency talk is nice, but how about a concrete example to back it up? The following is a simple C# console program I whipped up, which displays the results of concatenating 20,000 times, through both the String and StringBuilder classes.
Results Concatenating 'Hello World' 20000 times using String.
Start Time: 5/3/2004 8:24:05 PM
Finish Time: 5/3/2004 8:24:16 PM
Concatenating 'Hello World' 20000 times using StringBuilder.
Start Time: 5/3/2004 8:24:16 PM
Finish Time: 5/3/2004 8:24:16 PM
Conclusion
As you can see from the results, there is an eleven second difference between the two. Although StringBuilder is very efficient, you don't want to use it during simple string manipulation, as it's more overhead than you need. Feel free to download the code, and use it for your own testing purposes - just keep in mind, that I'm running a P4 2.4ghz, so results will vary.