Hi friends,
I want to know that what's the advantage of using System.Text.StringBuilder over System.String?
Advantage of using StringBuilder in C#
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Feb 12, 2012, 2:37 AM EST
Jignesh TrivediRank #16 · 50.3K reputationPosted Feb 12, 2012, 6:20 PM EST
string is immutable and you allocate new memory each time you append strings.
StringBuilder allows you to add characters to an object and when you need to use the string representation, you call ToString() on it.
please refer.
http://www.codeproject.com/Articles/6771/String-Vs-StringBuilder-C
http://msdn.microsoft.com/en-us/library/2839d5h5
hopr this help.