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 / akash

Both the String and StringBuilder class are used to store
strings. One exception is when we change the value in the
string it will create a new String object is creating in
memory and assign the new value.

eg: String name = "Sundar";

A new name object is creating in memory and the
value "Sundar Rahul" is assinging to the newly created
space.

eg: String name = "Sundar Rahul";

But StringBuilder class occupies the same space even if you
change the value.

StringBuilder gives you better performance than String
class when you perform string manipulations like string
concatenation.

You can use StringBuilder's Append() method to use
concatenation and for String use "+".

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is delegates and events?

878


In C#, explain the difference between overloading and overriding.

1059


Why static variables are used?

954


Does c# support a variable number of arguments?

956


Is c# pass by value?

862


What is difference between private and static constructor?

881


What is the difference between array and arraylist in c#?

973


Who introduced c#?

824


Distinguish between finally and finalize blocks?

869


Differentiate between sqlclient oledb and providers?

910


Why delegate is used in c#?

873


Any problem found in vs.et

956


What is the difference between system.string and system.text.stringbuilder classes?

950


Distinguish between the Debug class and Trace class with its functionality?

956


What is polymorphism and its types in c#?

853