What's the advantage of using System.Text.StringBuilder over
System.String?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What is the difference between trace and debug in asp.net?
Breifly explain about stack and heap memory Managemet?
What would be salary for 6+ years of experience in ASP.NET in different metro city in india?
Is It Possible for Static Variables access normal variable? and Normal Varialbe Access the static Variables?
1 Answers Phoenix Technologies,
How does session authentication work?
How do you validate the controls in an ASP .NET page?
What is smart navigation?
Compare and contrast between inline and code behind - which one is best?
what is narmalization
What is distributed system in asp.net?
what are webservices?In which circumstances we can go for webservices?
Explain login control and form authentication.