What is the .NET equivalent of java.lang.StringBuffer
?
1 Answer
It's System.Text.StringBuilder
. Note that in modern Java you'd use java.lang.StringBuilder
too. (It's like StringBuffer
, but without the synchronization - I can't remember the last time I wanted the synchronization of StringBuffer
. Note that the .NET StringBuilder
isn't thread-safe either, but again, I can't remember the last time I found that to be a problem.)
-
You don't want the synchronization of StringBuffer, ever -- it doesn't actually make code thread-safe. See jeremymanson.blogspot.com/2008_08_01_archive.html– faddenJan 27, 2016 at 23:49