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 is edm in entity framework?
What is main objective of asp.net mvc 4 or what is new in mvc4 ?
what is dot net? what is use dot net? what is benifit of dot net?what is vb dot net? what is ado dot net? what is c#?
What is the use of razor view engine?
How to Create an Intranet Site Using ASP.NET MVC?
What is viewstart page in mvc?
What is the need of Action Filters in ASP.Net MVC
What are the main features of asp.net mvc 4 used by asp.net web api?
What is meant by viewdata?
What is the 'page life cycle' of an ASP.NET MVC?
Is it possible to cancel filter execution?
What is disconnected scenario? : Entity framework
Explain what languages does the .net framework support?
Will the name change be reflected in any of the existing .net framework 2.0 apis, assemblies, or namespaces?
Explain the new features 3.5 framework against with the tool?