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 Main difference between String and
StringBuilder and why do we use StringBuilder.

Answer Posted / wavare santosh

What is the difference between String and StringBuilder?

Both String and StringBuilder are classes used to handle
strings.

The most common operation with a string is concatenation.
This activity has to be performed very efficiently. When we
use the "String" object to concatenate two strings, the
first string is combined to the other string by creating a
new copy in the memory as a string object, and then the old
string is deleted. This process is a little long. Hence we
say "Strings are immutable".

When we make use of the "StringBuilder" object, the Append
method is used. This means, an insertion is done on the
existing string. Operation on StringBuilder object is
faster than String operations, as the copy is done to the
same location. Usage of StringBuilder is more efficient in
case large amounts of string manipulations have to be
performed.

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 an icollection in c#?

891


What is Covariance and contravariance in C#?

1064


Explain how obfuscator works in .net

997


What is default value of decimal c#?

880


Can we inherit sealed class in c#?

881


What is CLR and its application.?

1047


Why do we use generics in c#?

978


Explain more on CLR

1157


What is the C# syntax to catch any possible exception?

939


There were a lot of questions asked, so I will list the topic (and add a what is "topic" and know pros/cons). Extreme programming, what is a transaction, various SDLC design approaches, what is a namespace, define a good test case, what is a stored proc, webservice? design patterns? linker? compiler? access modifiers? stack vs. queue? arrays vs. linked lists? sorting algorithms? recursion? OOP principles?

2024


How to declares a two-dimensional array in C#?

1025


How do I create a dbml file?

977


What is property in c#?

913


Is array ienumerable c#?

886


What are c# i/o classes? What are the commonly used i/o classes?

925