What's the advantage of using System.Text.StringBuilder over
System.String?

Answers were Sorted based on User's Feedback



What's the advantage of using System.Text.StringBuilder over System.String?..

Answer / prathap

StringBuilder is more efficient in the cases, where a lot of
manipulation is done to the text. Strings are immutable, so
each time it's being operated on, a new instance is created.

Is This Answer Correct ?    23 Yes 1 No

What's the advantage of using System.Text.StringBuilder over System.String?..

Answer / article

Hi..

Mutable & Immutable

1)string is immutabel.
i.e. whenever you create any changes to a string a new
object is created in memory.
2)StringBuilder has advantage String
To overcome this the stringBuilder is provided we can make
ammendments to the stringBuilder object without creating a
new object. Therefore whenever a lot operations are to be
made on a string then StringBuilder should be used in place
of String.

Thank's
Pradhan Prasanta Kumar
http://globaltouch.in

Is This Answer Correct ?    9 Yes 3 No

What's the advantage of using System.Text.StringBuilder over System.String?..

Answer / abhinay kumar

stiringbuilder is mutable but string is immutable

i.e mutable means that if we define a variable with
stringbuilder and assigne the value to another
stringbuilder variable and if we change the value then the
reflaction will be seen on the both variable (it made
change on the same memory location reference)

immutable means if we define a variable with string and
assigne the value to another string variable and if we
change the value then the reflaction will not be seen on
the both variable

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

What is asp.net version?

0 Answers  


What are all the various Estimation Techniques available ?

0 Answers   MCN Solutions,


Explain about ASP.NET?

0 Answers  


How you can stop the validation of ASP.NET controls from client side?

0 Answers   Sans Pareil IT Services,


How Session outproc in Sqlserver stored?

0 Answers   CGI,


Differentiate an ADO.NET Dataset and an ADO Recordset with its functionality?

3 Answers   Siebel,


Just by seeing the signature of the bean how can you specify whether it is a stateful or stateless session bean?

0 Answers  


What are all the ways to find out types of objects?

5 Answers   HCL,


What is the main differences between asp and asp.net?

0 Answers  


What is web.config. How many web.config files can be allowed to use in an application?

6 Answers   Accenture, HCL, InterGraph, iSoft,


Explain about secure socket layer?

0 Answers  


Can you explain page lifecycle in net?

0 Answers  


Categories