Qus:    Difference between String and StringBuilder?
Dec 15, 2020 15:56 DotNet 2 Answers Views: 1304 PADMAKEECHU

A string is immutable means you cannot change it after it was created. Any operation that appears to change the string instead returns a new instance whereas when you need a mutable string, such as where you need to change lots of things, you use a StringBuilder which is a buffer of characters that can be changed.

Prev Next
Answers (2)
PARTH Dec 16, 2020 13:23
Answer:   A string is immutable means you cannot change it after it was created. Any operation that appears to change the string instead returns a new instance whereas when you need a mutable string, such as where you need to change lots of things, you use a StringBuilder which is a buffer of characters that can be changed.

DIVYA Dec 16, 2020 19:00
Answer:   String is an immutable object and StringBuilder is a Mutable Object. Performance wise string is slow because its’ create a new instance to override or change the previous value.

Post Your Answer
Guest User

Not sure what solution is right for you?

Choose the right one for you.
Get the help of the experts and find a solution that best suits your needs.


Let`s Connect