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

Between windows authentication and sql server authentication, which one is trusted and which one is untrusted?

975


Is int an object in c#?

902


What does type safety mean?

1076


Why main is static in c#?

1045


What is a dll in c#?

912


What are the types of operator?

865


Why it's said that writing into .NET Application Configuration Files is a Bad Idea?

970


Is constructor a static method?

998


What is the use of 'as' Keyword in C# ?

1025


What is the use of ienumerable in c#?

1065


Describe the parts of assembly.

953


Is array a collection c#?

921


Explain About delegates

1027


Which function is the entry point for a DLL in MS Windows 3.1?

1172


Are arrays immutable c#?

1052