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

What are actions in c#?

871


Is int a struct in c#?

898


What is global asax in c#?

931


Explain publishers and subscribers in events.

949


Why do we need interfaces in c#?

892


Is object an int c#?

922


Is string passed by reference in c#?

917


In which order the constructor is called for an inherited class?

1044


Explain how is the dll hell problem solved in .net?

855


How do I stop my console from closing in c#?

903


What is expression tree in c#?

914


What is strong name assembly?

864


What is the difference between as and is operators in c#?

921


How does inheritance work in c#?

1110


What are the differences between system.string and system.text.stringbuilder classes?

994