• Advertisement
Sign in to follow this  

string.insert() broken in C#?

This topic is 4157 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

string foo = "foo"; string boo = "boo"; foo.Insert(2, boo); textBox1.Text = foo; I'm getting "foo". Thanks.

Share this post


Link to post
Share on other sites
Advertisement
The C# strings are immutable; they cannot be modified. The manipulation methods therefore return a new modified string:

foo = foo.Insert(2, boo);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement