I want something that replaces text between two occurences of the same string as follows:
Input:- "abcdefghcd","cd","k"
Output :- "abkefghk"
You might think that a simple thing such a .replace() would work, but actually its not that. Some more examples-
Input:- "123*45","*","u"
Output:- "123*45" # No change because there aren't two occurences of "*"
Input:- "text*text*hello*text","*","k"
Output:- "textktextkhello*text"
I don't know how to do it. Any ideas?