I have a program that gets a string from a method. I want to know how to insert a string value to that string at certain positions.
For example:
mystring = "column1 in('a','b')column2 in('c','d')column3 in('e','f')";
Here, how would I insert the string value " and " after every occurance of the character ')' in mystring?
PS. If possible, also include how not to insert it right at the end.
Probably the simplest:
mystring = mystring.Replace(")", ") and ");
mystring = mystring.Substring(0, mystring.Length - " and ".Length);
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