I need to replace ALL occurrences of '|B' with '' I've tried using 'replace' which only replaces the first occurrence in a string, and both of the following ReplaceAll prototypes neither of which produce the desired result:
String.prototype.replaceAll = function(search, replacement) {
var target = this;
return target.replace(new RegExp(search, 'g'), replacement);
};
and
String.prototype.replaceAll = function(search, replacement) {
var target = this;
return target.split(search).join(replacement);
};
Any assistance is greatly appreciated!