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

How we can add the CSS in ASP.Net MVC?

774


What are actions in asp.net mvc?

793


what is minimum requirement for entity framework applications to run?

809


What is entity framework used for?

743


How to bind table colum with gridview column?

814


What is main objective of asp.net mvc 4 or what is new in mvc4 ?

814


Explain dependency resolution?

815


Is .net framework going away?

760


What are the difference between asynchronous controller implementation between asp.net mvc 3 & asp.net mvc 4?

799


What is Separation of Concerns in ASP.NET ASP.Net MVC?

802


Explain the role of assembly in the .net framework.

771


Does Tempdata hold the data for other request in ASP.Net MVC?

736


how do you mark a property as required? For example, for a project, the name is a required field.

794


What are the 3 segments of the default route, that is present in an ASP.NET MVC application?

802


explain lazy loading, eager loading, and explicit loading?

751