Search and Replace - Better Advanced Solution

Stupidly, I hadn’t realised that the ‘hints’ page is actually a comment thread itself and lots of other people have posted solutions there already. There are a couple of solutions there that doesn’t use replace. It’s very interesting to look at the different ways it can be done. My favourite is this one, freeCodeCamp Algorithm Challenge Guide: Search and Replace which is splitting on the word to be matched and then reconstructing it as the input to join. Very clever.