I need to insert some text as the first character of my textbox when a button is clicked.
Here is what I have tried:
private void btnInsert_Click(object sender, EventArgs e)
{
txtMainView.Text.Insert(0, "TEST");
}
This fails to insert the text when I click the button. Anyone have an idea what I am doing wrong?
Strings are immutable in .NET Framework so each operation creates a new instance, obviously does not change original string itself!
For more details on
Stringclass see MSDN page Strings (C# Programming Guide)