string.insert() broken in C#?
string foo = "foo";
string boo = "boo";
foo.Insert(2, boo);
textBox1.Text = foo;
I'm getting "foo".
Thanks.
The C# strings are immutable; they cannot be modified. The manipulation methods therefore return a new modified string:
foo = foo.Insert(2, boo);
foo = foo.Insert(2, boo);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement