Optimize code running time in ASP. NET
String is an immutable object - it means that whenever you modify its content it will allocate a new string and this takes time (and memory?). Using StringBuilder you modify the actual content of the object without allocating a new one. So use StringBuilder when you need to do many modifications on the string.