Javascript String replaceAll(search, replacement)

Description

Javascript String replaceAll(search, replacement)


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



PreviousNext

Related