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
What are action filters?
What is the difference between adding routes, to a webforms application and to an mvc application?
What are the 2 ways of adding constraints to a route?
what is use of entitydatasource control?
Mention some action filters which are used regularly in ASP.Net MVC?
How do you assign a value to a complex number 7 how has exception hand changed in .net framework 4.0?
Can you use Razor code in Javascript in ASP.Net MVC?
What is layout in mvc?
Can you explain model, controller and view in mvc?
What is the difference between viewbag and viewdata in asp.net mvc?
How OS come to know whether to load the .net framework when we run an .exe created using .Net framework?
What is attribute routing in mvc?
What are the advantages of razor view engine?
How can I return string result from action in asp.net mvc?
What does a viewmodel do?