Mutating Strings

Today, we question our beliefs! Is string really immutable? [code lang=csharp] string message = "Hello World!"; Console.WriteLine(message); // Prints "Hello World!" unsafe { int length = message.Length; fixed (char *p = message) { for (int index = 0; index < length; ++index) { *(p + index) = '?'; } } } Console.WriteLine(message)…