Nodejs String Trim Trim()

Here you can find the source of Trim()

Method Source Code

String.prototype.Trim = function(){
   return this.replace(/(^\s*)|(\s*$)/g,"");
};


}

Related

  1. trimfast()
    String.prototype.trimfast = function() {
      var  str = this.replace(/^\s\s*/, ''),
        ws = /\s/,
        i = this.length;
      while (ws.test(this.charAt(--i)));
      return str.slice(0, i + 1);
    };
    (function($){
      $.fn.trimval = function() {
    ...
    
  2. trimj()
    String.prototype.trim  = jCube.String.trim  = function () {
      return this.replace( /^\s+|\s+$|^\n+|\n+$|^\t+|\t+$/g, "");
    
  3. 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 + ')+' );
    ...
    
  4. Trim()
    String.prototype.Trim = function(){
      return this.replace(/(^\s*)|(\s*$)/g, "");
    };
    
  5. Trim()
    String.prototype.Trim = function() {
      return this.lTrim().rTrim();
    };
    
  6. Trim()
    String.prototype.Trim = function() 
      var m = this.match(/^\s*(\S+(\s+\S+)*)\s*$/);  
      return (m == null) ? "" : m[1];  
    
  7. Trim(charlist)
    String.prototype.Trim = function(charlist) {
      return this.lTrim(charlist).rTrim(charlist);
    };