Hi friends,
What's the advantage of using System.Text.StringBuilder over System.String?
Thank you
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
Kunal VaishyaRank #990 · 2K reputationPosted May 14, 2012, 2:53 AM EDT
refer this
http://www.dotnetperls.com/stringbuilder
EhteshamRank #3,979 · 374 reputationPosted May 14, 2012, 3:02 AM EDT
Consider the following
string str="Hi";
str =str +" John";
from the above a new string will be created as "Hi John" instread of adding " John" to existing string
using Stringbuilder you can edit the contents without creating a new memory
SenthilkumarRank #387 · 6.5K reputationPosted May 14, 2012, 3:04 AM EDT
String is immutable, when you do the string concatination it will append the string every time in new place. when you do large it will occupy the most spaces.
Where string builder will allot a space and do it with in. It is best for large operations and string is best fit for small string operations.
Satyapriya NayakRank #47 · 31.5K reputationPosted May 14, 2012, 9:09 AM EDT
Please refer Our recommended articles
http://www.c-sharpcorner.com/uploadfile/puranindia/stringbuilder-class-in-C-Sharp1/default.aspx
http://www.c-sharpcorner.com/uploadfile/jitendra1987/string-and-stringbuilder-classes/default.aspx
http://www.c-sharpcorner.com/UploadFile/puranindia/stringbuilder-class-in-C-Sharp/
http://www.c-sharpcorner.com/uploadfile/hirendra_singh/modification-in-string-using-stringbuilder-class-in-C-Sharp/default.aspx
http://www.c-sharpcorner.com/UploadFile/mahesh/StringBuilderComp11232005235258PM/StringBuilderComp.aspx
Thanks