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?s the difference between System.String and
System.StringBuilder classes?

Answer Posted / sandeep joshi

String and StringBuilder class stores strings. But when you
cannot change a String object after creating one.
eg: String name = "Joshi";
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 = "Sandeep Joshi";

A new name object is creating in memory and the
value "Rengan nathan" 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.
i hope this may help u

Is This Answer Correct ?    20 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I use .NET components from COM programs?

915


Can we overload the main method in c#?

954


What is the use of functional interface?

921


What is a delegate? How can it works?

1143


Define parsing? Explain how to parse a datetime string?

967


Explain different properties of object oriented systems.

984


Explain About multi level and multiple inheritance how to achieve in .net

1035


How jit (just in time) works?

964


What are get and set in c#?

1006


What is a cs file?

990


How many bits is int32?

952


What is a multi line comment?

964


What is typeof c#?

959


What is lazy loading c#?

1040


How is a string immutable?

917