Replace all pattern occurrences - Node.js String

Node.js examples for String:Replace

Description

Replace all pattern occurrences

Demo Code

String.prototype.replaceOccurrences = function (pattern, replace) {
    return this.replace (RegExp(pattern,'gi'),replace);
};

Related Tutorials