I’m facing this abnormal situation. The following code doesn’t work properly:
string temp = "heythere";
Console.WriteLine(temp);
temp.Insert(3, "hello");
Console.WriteLine(temp);
Isn’t it supposed to output like “heyhellothere” ? But it does “heyrehere” (no change).
Strings are immutable, they don’t change in-place. Try: