I am struggling with a coding issue that involves manipulating a string.
The original string I have is "Hello This is world This".
Here is the code snippet I have tried:
var patt = 'Hello This is world This'
var res = patt.constructor;
alert(patt.replace(new RegExp('('This')', 'gi'), "<b>$1</b>"));
Unfortunately, my attempts to format the text as needed have not been successful.
Essentially, what I need to do is bold all words in the string except for "This".
If anyone could provide some assistance or guidance on how to achieve this, it would be greatly appreciated.
Thank you for your help!