If I have a number of occurences of a substring in a string, is there any way I can replace a specific occurence, rather than all occurences.

I have tried everything, but as of yet I have not found a way to accomplish this.

For example, if I have the string 'testabtestabtestab' and want to replace the second occurence of 'ab' with 'ing' but none of the others, how could I do this? If possible, a general way that can be applied to different strings and substrings.

I would aprecaite any help,

Thanks a lot.