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 / shaveen kaushal

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

Regards
Sridhar R
Nothing is illegal, Until You Get Caught

Is This Answer Correct ?    39 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between abstraction and encapsulation in c#?

894


Can you declare a field readonly?

877


How do I create multifile assembly?

874


How do you convert byte array to hexadecimal string, and vice versa?

1034


What are logical operators in c#?

891


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

862


Will the following code compile and run?

938


What are the ways in which client can create object on server in cao model?

913


What is the difference between ienumerable and iqueryable?

879


can you declare an override method to be static if the original method is not static?

955


I have 3 overloaded constructors in my class. In order to avoid making instance of the class do I need to make all constructors to private?

907


What is type class in c#?

912


What is the difference between == and object.equals?

920


Is string nullable in c#?

900


Why is ienumerable used?

841