What is the difference between string and stringbuilder in c#?



What is the difference between string and stringbuilder in c#?..

Answer / Anupam Saxena

"StringBuilder" is a mutable (changeable) version of "String". It's more efficient when you need to modify a string multiple times, as it avoids creating new strings for each modification. On the other hand, Strings are immutable in C#, so each modification creates a new string.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Can you drink alcohol with a loop recorder?

1 Answers  


Is null in c#?

1 Answers  


what is generics? can u explain 5 to 6 examples on generics that covers class,method,structure,list,delegates?

1 Answers   CTS,


What is the use of 'as' Keyword in C# ?

1 Answers   HCL,


I have to create a windows application using C# .net to Modifiy the XML file. The application have to show the node and node value. plz help me.

3 Answers   Merrill Lynch,


What is expression tree in c#?

0 Answers  


What is the solution if you need to manipulate sets of items?

1 Answers  


What is the difference between int.parse and int.tryparse methods?

1 Answers  


The int maps to which C# keyword in .NET type?

1 Answers   Siebel,


What is a generic in c#?

1 Answers  


What are properties and indexer?

3 Answers   TCS,


If a class derives from another class, will the derived class automatically contain all the public, protected, and internal members of the base class?

1 Answers  


Categories