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 / anandha kumar t

Both String and StringBuilder are classes used to
handle the 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 ?    81 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is dao in c#?

922


What is the difference between writeline and write in c#?

902


What is Private Constructor? and it’s use? Can you create instance of a class which has Private Constructor?

1030


Define acid rule of thumb for transactions in c#.

940


What are the new features in c# 2.0?

1029


Why do we need generics in c#?

982


What is data set in c#?

973


How do you specify a custom attribute for the entire assembly?

1030


What is the difference between constant and readonly in c#?

996


What is the difference between double and decimal in c#?

1022


What is the difference between hashtable and dictionary in c#?

968


What is parsing?

973


What is overloading in c#?

956


How do I get deterministic finalization in c#?

1105


If a method's return type is void, can you use a return keyword in the method?

929