List of utility methods to do String Filter
filter(f)String.prototype.filter = function(f) { return this.split("").filter(f).join(""); }; | |
filter(func)String.prototype.filter = function(func) { str = this.split(""); var ans = []; str.forEach(function(x) { if (func(x)) { ans.push(x); }; }); return ans; ... |