4
Reply

What’s the advantage of using System.Text.StringBuilder over System.String?

Manu

Manu

Jul 12, 2006
11k
0

    by the use of System.Text.stringBuilder we can save memory wastage & time Wastage let we use string without stringBuilder &perform concatenation in loop. for all concatenations objects are created after concatenation buffer are destroyed so we need large memory & time so we use StringBuilder rather than String

    Mukesh Kumar
    June 27, 2017
    0

    by the use of System.Text.stringBuilder we can save memory wastage & time Wastage let we use string without stringBuilder &perform concatenation in loop. for all concatenations objects are created after concatenation buffer are destroyed so we need large memory & time so we use StringBuilder rather than String

    Mukesh Kumar
    June 27, 2017
    0

    Basically, use a string builder if you plan on doing a lot of concatenation operations. It will save you some time and memory when executing (which is especially handy if you run that code snippet a lot, or if you are running on a web server, for instance).

    smruti padhy
    November 28, 2016
    0

    StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it’s being operated on, a new instance is created.

    Manu
    July 12, 2006
    0