Delete all blank spaces, all pattern occurrences - Node.js String

Node.js examples for String:String Value

Description

Delete all blank spaces, all pattern occurrences

Demo Code

String.prototype.deleteBlankSpaces = function () {
    return this.replace(/\s/gi,"");
};


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

Related Tutorials