The concatenation in many language using the
var myString = new Array("Hello");
var myString = "Hello";
myString += " ";
myString += "world !";
In C#, does the += operator create a new string ?
String is immutable in C# and Java. That means you can not modify it. Every method that modifys a string (
+= executes a method too) returns a new instance of a
StringBuilder more efficient that using
.Join() on a
StringBuilder is more performant (that are some nanosecs per call) than using
.Join on an
So it does make "sence" when you do that really often in a loop or something.