rafaelmaeuer
10/9/2017 - 1:06 PM

How to replace all occurrences of a string in JavaScript? - From https://stackoverflow.com/questions/1144783/how-to-replace-all-occurrences-

String.prototype.replaceAll = function(search, replacement) {
    var target = this;
    return target.split(search).join(replacement);
};