Javascript String replaceAll(str, replaceStr)

Description

Javascript String replaceAll(str, replaceStr)


'use strict';/*from  ww w.j av  a 2  s.  c  om*/

String.prototype.replaceAll = function(str, replaceStr) {
    return this.replace(new RegExp(str, 'gm'), replaceStr);
};



PreviousNext

Related