Suppose I have a string hello and I want it to subtract from the strings.
hello_my_good_worldmy_hello_good_worldmy_good_hello_world
And the output from above strings must be like following respectively.
my_good_worldmy_good_worldmy_good_world
Please note that how underscore _ got removed too. If string hello is at the start then it should remove underscore ahead, If it is in the middle then it should remove either next or previous underscore. So I don't have duplicate underscores. And if substring is at the end then it should remove previous underscore. I tried using JS replace method but I can remove only substring. Haven't figured out how to handle duplicate underscores to eliminate them too.