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

When can a derived class override a base class member?

876


What are the Features in .net framework 1.1

975


What does console writeline do?

882


Is a structure a class?

920


What is the difference between serialization and deserialization in c#?

1015


Illustrate race condition?

891


What is executenonquery c#?

857


What does .length do in c#?

922


What is dataset c#?

918


What is the use of ispostback in c#?

857


Can we extend sealed class in c#?

891


Is c# substring zero based?

953


What is difference between array and collection?

1034


How many types of namespaces available in version4?

925


What is the concept of strong names?

965