Nodejs String Trim Left leftTrim()

Here you can find the source of leftTrim()

Method Source Code

String.prototype.leftTrim = function () {
    return this.replace(/^\s+/, "");
}

Related

  1. lTrim()
    String.prototype.lTrim = function()
        return this.replace(/(^[\\s]*)/g, "");
    
  2. lTrim()
    String.prototype.lTrim = function(){
      str = this;
       var i;
        for(i=0;i<str.length;i++)
            if(str.charAt(i)!=" "&&str.charAt(i)!=" ")break;
        str=str.substring(i,str.length);
        return str;
    ...
    
  3. lTrim()
    String.prototype.lTrim = function() {
      return this.replace(/(^\s*)/g, "");
    };
    
  4. lTrim()
    String.prototype.lTrim = function () {
      var $whitespace = new String(" \t\n\r");
      if ($whitespace.indexOf(this.charAt(0)) != -1) {
        var $i = this.length;
        var $j = 0;
        while ($j < $i && $whitespace.indexOf(this.charAt($j)) != -1) {
          $j++;
        return this.substring($j, $i);
    ...
    
  5. lTrim(charlist)
    String.prototype.lTrim = function(charlist) {
      if (charlist === undefined)
        charlist = "\s";
      return this.replace(new RegExp("^[" + charlist + "]+"), "");
    };
    
  6. leftTrim()
    String.prototype.leftTrim = function() { 
       return this.replace(/(^\s*)/g, ""); 
    
  7. leftTrim()
    String.prototype.leftTrim =function(){
        return this.replace(/^\s+/,'');
    
  8. lefttrim( )
    String.prototype.lefttrim = function( )
      return( this.replace(new RegExp("^[\\s]+", "gm"), "") );
    };
    
  9. TrimStart( aimStr )
    String.prototype.TrimStart = function( aimStr )
        var str = this;
        var re = My.RegExp.InvolvedCharsRegExp;
        var reStart;
        if ( aimStr )
            aimStr = aimStr.replace( re, '\\$1' );
            reStart = new RegExp( '^(' + aimStr + ')+' );
    ...