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 System.String and
System.StringBuilder classes?

Answer Posted / shyam vishwakarma

String and StringBuilder class stores strings. But when you
cannot change a String object after creating one.
eg: String name = "Prasad";
By saying you cannot change the name object means you cannot
change the value in name object internally. When you change
the name object value to something else, a new String object
is creating in memory and assign the new value.

eg: name = "Prasad Reddy";

A new name object is creating in memory and the value
"Prasad Reddy" 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.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is threading in c# with example?

983


What are controls in c#?

996


How can we sort the elements of the array in descending order?

991


What does clr stand for?

978


What are modifiers in c#?

924


Is there any sample c# code for simple threading?

970


What is marshalling in c#?

917


What is difference between .net and c#?

972


If the interface in c# only contains the declaration of the methods and we need to define those methods in the class, then why we use the interface?

1047


How to exclude a property from xml serialization?

1057


What is the difference between readkey and readline in c#?

932


What are instance fields in c#?

1054


What do you mean by winforms in c#?

1006


What is a linq in c#?

924


What is a console application in c#?

1003