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 the difference between page-level caching and fragment caching?

0 Answers  


What does session_start () do?

0 Answers  


when using personlization, how do you access over setting at runtime?

1 Answers  


How to retrieve user name in case of Window Authentication?

0 Answers  


Explain server side state management system.

0 Answers  






What are the steps to follow to host a web application on a web server?

0 Answers   MCN Solutions,


If iam developing an application that must accomodate multiple security levels though secure login and my asp.net web appplication is spanned across three web-servers (using round-robbin load balancing) what would be the best approach to maintain login-in state for the users?

0 Answers  


What is the difference between Classic ASP and ASP.Net?

0 Answers  


What kind of data can be stored in viewstate?

0 Answers  


What is cookies cache and session?

0 Answers  


how to integrate Language conversion, without asking the enduser to download font, it should auto integrate

1 Answers  


What are the asp.net security controls?

0 Answers  


Categories