I have a string which may contain "title1" twice in it.
e.g.
server/api/shows?title1=its always sunny in philadelphia&title1=breaking bad ...
I need to change the second instance of the word "title1" to "title2"
I already know how to identify whether there ARE two instances of the string in the string.
int occCount = Regex.Matches(callingURL, "title1=").Count;
if (occCount > 1)
{
//here's where I need to replace the second "title1" to "title2"
}
I know we can probably use Regex here but I'm not able to get the replace on the second instance. Can anyone give me a hand?