I have (hopefully) a simple problem.
String.Insert(0, "test");
is not working, yet:
String.Text += "test";
does..? I need Insert so I can insert something in the middle of a string.
I'm such an idiot, instant Google search fixed this.
String.Insert does not modify the string it is called on, but instead returns a new string with the inserted text in.
So I needed:
String = String.Insert(0, "test");
it should work
see the below example
string names = "Romeo Juliet";
string shakespeare = names.Insert(6, "and ");
Console.WriteLine(shakespeare);
the result will be Romeo and Juliet
see the fiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With