<me*******@yahoo.com> wrote:
one question on why string is provided ?
stringbuilder offers more performance, less work for GC and good amount
of methods to manage text in it.
When there are many benefits with stringbuilder, why still string is
supported in framework ?
is it only for any compatibility and threadsafe nature of string ?
No. Strings are immutable, which is invaluable. StringBuilders should
be used as their names suggest - to *build* strings. The final form
should be as a string though.
Note that it's not always more efficient to use StringBuilder, by the
way - see
http://www.pobox.com/~skeet/csharp/stringbuilder.html
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too