Nodejs String Remove removeEndLine()

Here you can find the source of removeEndLine()

Method Source Code

/**/* w  w  w. j a va 2  s  . c o  m*/
 * Trimming for strings.
 */
String.prototype.removeEndLine = function() {
    var tmp = "";
    for(var i = 0, length = this.length; i < length; i++) {
        var c = this.charAt(i);
        if(c != "\n" && c != "\r") {
            tmp += c;
        }
    }
    return tmp;
}

Related

  1. 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;
    
  2. removeClasses(s)
    String.prototype.removeClasses = function(s)
        return this.replace(/style="[^"]*"|class="[^"]*"/gi, "");
    
  3. removeComma()
    String.prototype.removeComma = function() {
        return(this.replace(/,/g,''));
    
  4. removeDiacritics()
    String.prototype.removeDiacritics = function() {
        var result = this.replace(/i/g, 'i')
                    .replace(/?/, 'c');
        return result;
    
  5. removeDots()
    String.prototype.removeDots = function() {
      return this.replace(/\./g, '');
    };
    
  6. removeFileExtension()
    String.prototype.removeFileExtension = function()
        var re = /(.*)\.[^.]+$/;
        return re.test(this);
    
  7. 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);
    
  8. removeMascara()
    String.prototype.removeMascara = function () {
        if (this.valueOf())
            return this.valueOf().replace(/\.|\/|-|_/g, "");
        return "";
    
  9. removeMultipleWhitespaces()
    String.prototype.removeMultipleWhitespaces = function () {
        return this.replace(/\s\s+/g, ' ');
    };