johnhk
2/29/2016 - 9:49 AM

ReplaceAll string

ReplaceAll string

String.prototype.replaceAll = function(search, replacement) {
    var target = this;
    return target.replace(new RegExp(search, 'g'), replacement);
};