Hi........
Oues: Hello all of you now i am write a string based program but i am not understand What is used of System.Text.StringBuilder ? and please explain .....What the advantage of using System.Text.StringBuilder over System.String?
Loading
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
Satyapriya NayakRank #47 · 31.5K reputationPosted Dec 3, 2011, 6:38 PM EST
The String object is immutable which means, every time you use any of the methods in the String class, you create a new string object in memory.
The StringBuilder class can be used when you want to modify a string without creating a new object. StringBuilder class is present in System.Text namespace where String class is present in System namespace
Advantage
StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it's being operated on, a new instance is created.Thanks
VulpesRank #55 · 29.2K reputationPosted Dec 4, 2011, 12:39 AM EST