Nodejs String Remove removeCharacters()

Here you can find the source of removeCharacters()

Method Source Code

String.prototype.removeCharacters = function() {
   //debugger;//from w w w.  java2 s  . c o  m
   var twoStrings = this.split(", "),
   array2 = twoStrings[1],
   array1= twoStrings[0],
   temp = "";

   for (var i = 0, length = array2.length; i < length; i++) {
      for (var j = 0, l = array1.length; j < l; j++) {
         if (array1[j] == array2[i]) {
            array1 = array1.remove(j);
            j--; 
         }
      }
   }
   return array1;
}

console.log(line.removeCharacters());

Related

  1. removeBlackLines()
    String.prototype.removeBlackLines = function () {
        return this.replace(/\n[\s\t]*\r*\n/g, '\n');
    };
    
  2. removeBr()
    String.prototype.removeBr = function()
      return this.replace(/(<br \/>|<br>)/g, '');
    };
    
  3. removeBreakLine()
    String.prototype.removeBreakLine = function() { 
      return this.replace(/(\r\n|\n|\r)/gm," ");
    
  4. removeBreakTags()
    'use strict';
    var DEV_MODE = false;
    String.prototype.removeBreakTags = function() {
      var target = this;
      return target.replace(new RegExp('<br/>', 'g'), ' ');
    };
    
  5. removeChar(character)
    String.prototype.removeChar = function (character) {
          return this.replaceAll(character, "");
    
  6. removeChars()
    String.prototype.removeChars = function () {
          varReturnStr = "" ;
          for ( var inx = 0 ; inx < this.length ; inx++ ) {
              if ( this.substring( inx, inx+1 ) != "-")
                          varReturnStr = varReturnStr + this.substring( inx, inx+1 ) ;
          return varReturnStr;
    
  7. removeClasses(s)
    String.prototype.removeClasses = function(s)
        return this.replace(/style="[^"]*"|class="[^"]*"/gi, "");
    
  8. removeComma()
    String.prototype.removeComma = function() {
        return(this.replace(/,/g,''));
    
  9. removeDiacritics()
    String.prototype.removeDiacritics = function() {
        var result = this.replace(/i/g, 'i')
                    .replace(/?/, 'c');
        return result;