Javascript String replaceAll(strReplace, strWith)

Description

Javascript String replaceAll(strReplace, strWith)


String.prototype.replaceAll = function(strReplace, strWith) {
    var reg = new RegExp(strReplace, 'ig');
    return this.replace(reg, strWith);
};



PreviousNext

Related