What?s the difference between System.String and
System.StringBuilder classes?
Answer Posted / sundarchum
Both the String and StringBuilder class are used to store
strings. One exception is when we change the value in the
string it will create a new String object is creating in
memory and assign the new value.
eg: String name = "Sundar";
A new name object is creating in memory and the
value "Sundar Rahul" is assinging to the newly created
space.
eg: String name = "Sundar Rahul";
But StringBuilder class occupies the same space even if you
change the value.
StringBuilder gives you better performance than String
class when you perform string manipulations like string
concatenation.
You can use StringBuilder's Append() method to use
concatenation and for String use "+".
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What the different phase/steps of acquiring a proxy object in webservice?
What is the difference between mobile application and desktop application?
What is exe in c#?
Does c# have its own class library?
What is difference between write and writeline in c#?
Wcf and what is difference between wcf and web services?
Give an example of removing an element from the queue?
Explane each and every methods of nterface Queue? Explain About performance issues on retrieving records
What is inumerable?
What is the advantage of constructor?
What does dbml stand for?
What is null in database?
What is the difference between an application domain and a process?
How do I open the console?
What is constants in c#?