Nodejs String Remove removeNonChars()

Here you can find the source of removeNonChars()

Method Source Code

String.prototype.removeNonChars = function(){
   return this.replace(/[^a-zA-Z0-9 -]/gi, "");
};

Related

  1. removeFileExtension()
    String.prototype.removeFileExtension = function()
        var re = /(.*)\.[^.]+$/;
        return re.test(this);
    
  2. removeFromList(c)
    String.prototype.removeFromList=function(c){
      var arr=this.split(c), i=1;
      for(;i<arguments.length;i++) delete arr[arguments[i]-1];
      return arr.filter(function(v){return v!==undefined}).join(c);
    
  3. removeMascara()
    String.prototype.removeMascara = function () {
        if (this.valueOf())
            return this.valueOf().replace(/\.|\/|-|_/g, "");
        return "";
    
  4. removeMultipleWhitespaces()
    String.prototype.removeMultipleWhitespaces = function () {
        return this.replace(/\s\s+/g, ' ');
    };
    
  5. removeNonAlphabeticCharacters()
    String.prototype.removeNonAlphabeticCharacters = function() {
        var result = this.replace(/[^a-zA-Z ]/g, '');
        return result;
    
  6. removeNonWords()
    String.prototype.removeNonWords = function () { 
      return this.replace(/[^\w|\s]/g, '');
    
  7. removeQoutes()
    String.prototype.removeQoutes = function() {
      return this.replace(/["']/g, "");
    };
    
  8. removeSpace()
    String.prototype.removeSpace=function(){
      return this.replace(/\s/g, "");
    
  9. removeSpaces()
    String.prototype.removeSpaces = function() {
      return this.replace(/\s+/g, '');
    };
    String.prototype.hashCode = function(){
      var hash = 0;
        if (this.length == 0) return hash;
        for (var i = 0; i < this.length; i++) {
            char = this.charCodeAt(i);
            hash = ((hash<<5)-hash)+char;
    ...