Qus:    What is String Builder? Which one Preferable string or String Builder?
Nov 20, 2020 19:20 DotNet 2 Answers Views: 1357 FRAUSKY

To avoid string replacing, appending, removing or inserting new strings in the initial string, StringBuilder was introduced. StringBuilder is a dynamic object. It doesn’t create a new object in the memory but dynamically expands the needed memory to accommodate the modified or new string.



StringBuilder is preferred since it performs faster than string in case we are modifying the string by appending string values.

Prev Next
Answers (2)
DIVYA Nov 21, 2020 14:24
Answer:   String Builder is a dynamic object. Its allow number of characters in string. Its does not create a new object in memory.
StringBuilder sb = new StringBuilder(“Hi Team!!”);
We can prefer StringBuilder. Beacuse it performs faster than string when appending multiple string values.

PARTH Nov 23, 2020 15:09
Answer:   To avoid string replacing, appending, removing or inserting new strings in the initial string, StringBuilder was introduced. StringBuilder is a dynamic object. It doesn’t create a new object in the memory but dynamically expands the needed memory to accommodate the modified or new string.

StringBuilder is preferred since it performs faster than string in case we are modifying the string by appending string values.

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