StringBuilderis more efficient in the cases, where a lot of manipulation is done to thetext. Strings are immutable, so each time it’s being operated on, a newinstance is created.
Liked By
Write Answer
What’s the difference between System.Text.StringBuilder and System.String?
Join MindStick Community
You have need login or register for voting of answers or question.
Amit Singh
16-Apr-2011Difference between StringBuilder and string
String and StringBuilder class stores strings. But when you cannot change a String object after creating one.
eg: String name = "amit";
By saying you cannot change the name object means you cannot change the value in name object internally. When you
change the name object value to something else, a new String object is creating in memory and assign the new value.
Example: name = "Amit Singh";
If you are doing string concatenation StringBuilder class is far better in performance than String class.
You can use StringBuilder's Append() method to use concatenation.
Uttam Misra
29-Oct-2010