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 / vijay rana

String class is immutable, means we can not change the
contents of string at run time,
for example
String s1="loin";
string s2=s1.insert(3,"g");
now s2 have the value login ,but one thing to notice here is
that we are not assigning this value into s1, because it is
not possible in String class
,but if we want to change the contents of s1 then we will
have to take the StringBuilder calss
because with the help of this class we can change the
contents of same string
examlpe:
String s1="loin";
s1=s1.insert(3,"g");
now s1 is "login"
here we are assigning the value again in s1,
this is the main difference between in string and
stringBuilder class

Is This Answer Correct ?    43 Yes 27 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can it prevents DLL Hell assembly versioning in .NET?

966


What is delegates in c#?

847


Explain the difference between abstract class and interface.

1095


What is private and shared assembly?

936


If I have more than one version of one assemblies, then how'll I use old version (how/where to specify version number?)in my application?

886


Explain about ODP.net

1184


Explain About Global.asax

914


Difference between debug.write and trace.write?

912


How do I declare a pure virtual function in c#?

919


What Is The Difference Between The System.array.copyto() And System.array.clone()?

956


Describe the process of “exception handling implementation” in c#?

910


Is array passed by reference in c#?

914


How many types of constructors are there?

833


Explanation on Generic?

915


What is event and delegates in c#?

933