In this series of articles, we will look into the ways to improve performance of our .NET code. We will discuss best practices to be followed while coding. In this article, we will discuss about StringBuilder usage and how it will improve our code performance. I will be using VS 2008 with C# for all the samples in this series. Most of us are familiar with string class. For all kind of operations on an array of characters, we will be using string objects. But, using string object in all scenarios is not feasible. It will make our code worse in performance aspect. We can improve performance by using StringBuilder objects in place of string objects. Usage of string object heavily reduces performance of the code. Since string is immutable object. Whenever, we modify the contents of a string object it will create a new string object for holding the new data and old string object will be garbage collected.String objects will be stored on heap, which will reduce the available space on heap for other objects. Now, we will see in what scenarios StringBuilder is better: