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 difference between System.String and
System.StringBuilder classes?

Answer Posted / chauhan rakesh botad

System.String is immutable; System.StringBuilder was
designed with the purpose of having a mutable string where a
variety of operations can be performed.

String is immutable.A new object is create if a string needs
to be modified.
While string builder object can be modified without creating
a new object.
stringbuilder class offers various methods like replace etc.

IN System.String
1.String is built in class in .net base classes.
2.In this we can do all the string operation like
substring,strcpy etc
but cant do editing .so thats called immutable.
3.System.StringBuilder class have ability of append function
that not available in Sting class

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, String builder object is used.
4.Insertion is done on the existing string.
5.Usage of String Builder is more efficient in case large
amounts of string manipulations have to be performed

string builder is used for many variety of operations
string cannot be used for that many operation

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is char * null terminated?

876


What are regular expressions? Search a string using regular expressions?

831


What is a int in c#?

831


Does the variables of a private class-level inherited?

953


What is the use of generics in c#?

813


What are properties in c#. Explain with an example?

846


How long does it take to learn c# for unity?

844


What language do desktop applications use?

901


What is .edmx file?

919


What are the different types of assemblies available and their purpose?

862


Explain the types of Polymorphism.

1039


What is the difference between C# 3.5 and C# 4.0?

882


How can you set image source dynamically from c# application to ”test.png” file?

1018


What is expression tree in c#?

863


How do you declare a method in c#?

873