Nodejs Utililty Methods String Trim Left

List of utility methods to do String Trim Left

Description

The list of methods to do String Trim Left are organized into topic(s).

Method

ltrim()
String.prototype.ltrim = function() {
    return this.replace(/^\s+/,"");
};
ltrim()
String.prototype.ltrim = function() {
  return this.replace(/^\s+/g,"");
ltrim()
var s1 = new String('  A  B  ');
String.prototype.ltrim = function(){
  var regexp = /^\s*/;
  var result = this.replace(regexp, '');
  return result;
};
console.log('||'+s1.ltrim()+'||');
ltrim()
String.prototype.ltrim = function() {
  return this.replace(/^\s*/g,'');
ltrim()
String.prototype.ltrim=function()
  return this.replace(/(^\s*)/g,'');
ltrim()
String.prototype.ltrim = function() {
  return this.replace(/(^\s*)/g, "");
ltrim()
String.prototype.ltrim = function() {
  return this.replace(/^\s+/,'');
ltrim()
String.prototype.ltrim = function(){
  return this.replace(/\s+$/, "");
};
ltrim()
String.prototype.ltrim = function(){
  return this.replace(/^\s+/, "");
};
ltrim()
String.prototype.ltrim = function()
  return this.replace( /^\s*/g, '' ) ;