I have a string like this
'I am a beautiful string ABC where sometimes ABC there ABC are weird tokens ABC'
I need to insert another token, let's say '123'
, before any occurrence of the token 'ABC'
in my string.
In other words the result I want to obtain is
'I am a beautiful string 123ABC where sometimes 123ABC there 123ABC are weird tokens 123ABC'
I have tried several solutions, but none looks to me elegant. Any suggestion to solve this problem would be appreciated.