Being new to C#, I was reading some guide. About strings, here I read (highlighting is mine):
Strings are immutable--the contents of a string object cannot be changed after the object is created, although the syntax makes it appear as if you can do this. For example, when you write this code, the compiler actually creates a new string object to hold the new sequence of characters, and the variable b continues to hold "h".
string b = "h"; b += "ello";
But trying the following code, it prints "hello".
string b = "h";
b += "ello";
System.Diagnostics.Debug.WriteLine(b);
So, am I misinterpreting what I read, or is the documentation wrong? Any other option? :)