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

How do you declare an arraylist?

942


How to add controls dynamically to the form using c#.net.

849


Is and as keyword in c# net?

914


How C# 4.0 supports dynamic programming language?

950


What is type checking in c#?

854


What floating point types is supported in C#?

976


Does console.writeline() stop printing when it reaches a null character within a string?

914


What is difference between override and new in c#?

1019


What is cookies c#?

843


Why we use methods in c#?

893


What is uint64_t?

928


Should I make my destructor virtual?

988


What is the purpose of c#?

947


Write the difference between TypeOf and GetType?

992


What is an enumerator c#?

881