Nodejs String Trim Trim(charlist)

Here you can find the source of Trim(charlist)

Method Source Code

String.prototype.Trim = function(charlist) {
  return this.lTrim(charlist).rTrim(charlist);
};

Related

  1. Trim( aimStr )
    String.prototype.Trim = function( aimStr )
        var str = this;
        var re = My.RegExp.InvolvedCharsRegExp;
        var reStart, reEnd;
        if ( aimStr )
            aimStr = aimStr.replace( re, '\\$1' );
            reStart = new RegExp( '^(' + aimStr + ')+' );
    ...
    
  2. Trim()
    String.prototype.Trim = function(){
      return this.replace(/(^\s*)|(\s*$)/g, "");
    };
    
  3. Trim()
    String.prototype.Trim = function() {
      return this.lTrim().rTrim();
    };
    
  4. Trim()
    String.prototype.Trim = function(){
      return this.replace(/(^\s*)|(\s*$)/g,"");
    };
    
  5. Trim()
    String.prototype.Trim = function() 
      var m = this.match(/^\s*(\S+(\s+\S+)*)\s*$/);  
      return (m == null) ? "" : m[1];