This is a simple one. I want to replace a sub-string with another sub-string on client-side using Javascript.
Original string is \'original READ ONLY\'
\'original READ ONLY\'
I prefer the regex approach,
newstring = oldstring.replace(/regexforstringtoreplace/, 'new string');
its also worth considering the g and i regex modifiers, these do a global replace (i.e. replaces all occurrences) and makes it case insensitive.
for example: