Here you can find the source of TrimStart( aimStr )
String.prototype.TrimStart = function( aimStr ) { var str = this; var re = My.RegExp.InvolvedCharsRegExp; var reStart;// ww w. ja v a 2 s.c om if ( aimStr ) { aimStr = aimStr.replace( re, '\\$1' ); reStart = new RegExp( '^(' + aimStr + ')+' ); } else reStart = /^\s+/; str = str.replace( reStart, '' ); return str; };
String.prototype.lTrim = function(charlist) { if (charlist === undefined) charlist = "\s"; return this.replace(new RegExp("^[" + charlist + "]+"), ""); };
String.prototype.leftTrim = function () { return this.replace(/^\s+/, "");
String.prototype.leftTrim = function() { return this.replace(/(^\s*)/g, "");
String.prototype.leftTrim =function(){ return this.replace(/^\s+/,'');
String.prototype.lefttrim = function( ) return( this.replace(new RegExp("^[\\s]+", "gm"), "") ); };
String.prototype.LTrim = function(){ return this.replace(/(^\s*)/g, ""); };
String.prototype.LTrim = function() { return this.replace(/^\s+/g, "");