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

Answer Posted / panchdev

stringbuilder:-
1-This class represents a string-like object whose value is a mutable sequence of characters.
2- The value is said to be mutable because it can be modified once it has been created by appending, removing, replacing, or inserting characters. For comparison, see the String class.
3-The default capacity for this implementation is 16, and the default maximum capacity is Int32.
string:-
1-A String object is called immutable (read-only) because its value cannot be modified once it has been created. Methods that appear to modify a String object actually return a new String object that contains the modification. If it is necessary to modify the actual contents of a string-like object, use the System.Text.StringBuilder class.

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are action filters?

604


What is the difference between adding routes, to a webforms application and to an mvc application?

550


What are the 2 ways of adding constraints to a route?

551


what is use of entitydatasource control?

605


Mention some action filters which are used regularly in ASP.Net MVC?

546






How do you assign a value to a complex number 7 how has exception hand changed in .net framework 4.0?

506


Can you use Razor code in Javascript in ASP.Net MVC?

665


What is layout in mvc?

567


Can you explain model, controller and view in mvc?

567


What is the difference between viewbag and viewdata in asp.net mvc?

620


How OS come to know whether to load the .net framework when we run an .exe created using .Net framework?

569


What is attribute routing in mvc?

577


What are the advantages of razor view engine?

531


How can I return string result from action in asp.net mvc?

569


What does a viewmodel do?

523