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 / stanly jose

String and StringBuilder class stores strings. But you
cannot change a String object after creating one.
eg: String name = "Stanly";
you wan to change the same string name to
eg: name = "Stanly Jose";
then a new String object is creating in memory and assign
the new value as "Stanly Jose".
(A new name object is creating in memory and the
value "Stanly Jose" is assinging to the newly created
space.)

But StringBuilder class occupies the same space even if you
change the value.

If you are doing string concatenation StringBuilder class
is far better in performance than String class.

You can use StringBuilder's Append() method to use
concatenation.

note:
system.string is immutable,system.stringbuilder was
designed with the purpose of having a mutable string where
a variety of operations can be performed.

Is This Answer Correct ?    14 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we need constructor in c#?

925


What are the return types in c#?

953


Is and as keyword in c# net?

964


Can an interface extend a class c#?

948


What is the difference between const and static read-only?

923


What are strings in c#?

930


Write the difference between TypeOf and GetType?

1023


What is the difference between do and while loop?

879


Is multiple inheritance possible in c#?

999


List down the reason behind the usage of c# language.

1298


How many constructor can a class have?

993


Explain the three test cases in unit testing?

998


What is an assembly loader?

938


What is icomparer in c#?

929


What are managed providers?

1007