Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the Main difference between String and
StringBuilder and why do we use StringBuilder.

Answer Posted / sandeep soni

String are Immutable (Not Modifiable). If you try to modify
the string it actually creates a new string and the old
string will be then ready for garbage collection.

StringBuilder when instantiated, creates a new string with
predefined capacity and upto that capacity it can
accodomate string without needing to create a new memory
location for the string....i mean it is modifiable and can
also grow as and when needed.

When the string needs to be modified frequently, preferably
use StringBuilder as its optimized for such situations.

Is This Answer Correct ?    113 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What to implement on my class Finalize or IDisposable

941


What is the delegates in c#?

875


What is a partial class. Give an example?

931


What are get and set in c#?

962


What is _viewstart cshtml?

846


Which is better python or c#?

825


What is an array of arrays called?

838


Explain the process of inheriting a class into another class?

959


What language is c# similar to?

887


What is predicate c#?

933


What are the 4 pillars of any object oriented programming language?

838


What do you mean by hashtable c#?

971


What are value types in c#?

863


Which property do we set on a Combo Box to display data on it prior to setting the DataSource ?

907


What is stringreader in c#?

839