Does string concatenation use StringBuilder internally?

Posted by JamesBrownIsDead on Stack Overflow See other posts from Stack Overflow or by JamesBrownIsDead
Published on 2010-05-20T19:01:30Z Indexed on 2010/05/20 19:20 UTC
Read the original article Hit count: 250

Filed under:
|
|
|

Three of my coworkers just told me that there's no reason to use a StringBuilder in place of concatenation using the + operator. In other words, this is fine to do with a bunch of strings: myString1 + myString2 + myString3 + myString4 + mySt...

The rationale that they used was that since .NET 2, the C# compiler will build the same IL if you use the + operator as if you used a StringBuilder.

This is news to me. Are they correct?

© Stack Overflow or respective owner

Related posts about c#

Related posts about compiler