Skip to main content
gamedev.net
🔒 Locked

string.insert() broken in C#?

Started by Calin 1 reply 1.2k views
Original Post
Calin
Calin
string foo = "foo"; string boo = "boo"; foo.Insert(2, boo); textBox1.Text = foo; I'm getting "foo". Thanks.
My project`s facebook page is “DreamLand Page”
Sharlin
Sharlin
The C# strings are immutable; they cannot be modified. The manipulation methods therefore return a new modified string:

foo = foo.Insert(2, boo);
Calin
Calin
oh, Thanks
My project`s facebook page is “DreamLand Page”

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.