I have a string which may contain \"title1\" twice in it.
e.g.
server/api/shows?title1=its always sunny in philadelphia&title1=breaking ba
The way P.S.W.G did is really awesome. but below I mentioned one simple way to get it done for those who do have problem in lambda and regex expression..;)
int index = input.LastIndexOf("title1=");
string output4 = input.Substring(0, index - 1) + "&title2" + input.Substring(index + "title1".Length, input.Length - index - "title1".Length);