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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted May 14, 2012, 1:09 PM
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
SenthilkumarPosted May 14, 2012, 7:04 AM
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.
EhteshamPosted May 14, 2012, 7:02 AM
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
Kunal VaishyaPosted May 14, 2012, 6:53 AM
refer this
http://www.dotnetperls.com/stringbuilder