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 DIFFERENCE BETWEEN STRING AND STRING BUILDER ?

Answer Posted / raviraj

String and String Builder class shows resemblance in terms
of values they accept(that contain series of haracters).But
the thing that distinguishes them is that string is
immutable .Immutable in the sense it will create a new copy
of memory whenever a new string is concatenated to the
existing string variable That means the existing memory is
deleted and replaced by the new memory.Whereas
Stringbuilder is mutable whenever we append a new string to
the existing string variable using append method the memory
containing the original string is extended to contain the
new string as well i.e, it won`t replace it with new memory
allocation.Hence performing string concatenations within
the same variable in the string class variables will affect
their performance.

Is This Answer Correct ?    17 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are structs value types c#?

940


What is a console operator?

952


What is an ienumerable in c#?

1051


How do I unload an application domain?

988


List down the different ide’s provided by microsoft for c# development.

931


Overloaded constructor will call default constructor internally?

1102


Can we have 2 main methods in c#?

952


Can you create an instance of a static class?

1047


Are c# destructors the same as c++ destructors?

1215


Is overriding of a function possible in the same class?

1006


Can a struct inherit from another struct or class in c#?

953


Is equal in c#?

925


Which namespaces are necessary to create a localized application?

1107


What is a di class?

1135


Can abstract class be instantiated c#?

983