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 / ankur prasad gupta

Difference..
String..
1.Its a class used to handle strings.
2.Here concatenation is used to combine two strings.
3.String object is used to concatenate two strings.
4.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
5.we say "Strings are immutable".

String Builder..
1.This is also the class used to handle strings.
2.Here Append method is used.
3.Here, Stringbuilder object is used.
4.Insertion is done on the existing string.
5.Usage of StringBuilder is more efficient in case large amounts of string manipulations have to be performed

Is This Answer Correct ?    19 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is writeline in c#?

829


What is an event in c#?

855


Explain the use of SN.exe

1045


How does substring work in c#?

925


You are designing a user control. You created new property called backgroundimage which is of type image. You wanted to disable storing this property in the user’s form. How to achieve this?

877


What is thread.sleep()?

862


What is this keyword in C#?

926


Can enum have methods c#?

844


What is callback delegate in c#?

831


What are the advantages of interface in c#?

900


Does c# support templates?

929


what is a structure in c#

1569


What is difference between ienumerable and list?

935


What is an escape sequence in c#?

930


Which namespace is required to implement trace ?

923