What is the Main difference between String and
StringBuilder and why do we use StringBuilder.

Answer Posted / ashwini choudhari

string class u can't directly the change the string value
and u want to do some manipulation with the string object
then it's give the new memory in stack when u can the do
the manipulation with the string object but in String
Builder class not happened to give the new memory
allocation in stack it just repalcing the some part of
string which u want repalce or appended so that the
performances increases.
Actually String Builder it is referneces type .

Is This Answer Correct ?    11 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between a method and a property?

460


Ho we can see assembly information?

522


What is application object in c#?

507


What is append in c#?

482


What is a multi line comment?

557






Why we use anonymous methods in c#?

493


What is difference between encapsulation and abstraction in c#?

460


Which constructor is called first in c#?

518


What is jagged array in c#?

548


What's new in c#?

491


What is the difference between protected and internal in c#?

468


How do I unload an application domain?

526


Explain the difference between and xml documentation tag?

498


My switch statement works differently! Why?

515


How to update the gui from another thread in c#?

558