Javascript String ltrim(charlist)

Description

Javascript String ltrim(charlist)

String.prototype.ltrim = function (charlist) {
  charlist = !charlist ? ' \\s\u00A0' : (charlist + '').replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g, '$1');
  var re = new RegExp('[' + charlist + ']+$', 'g');
  return this.replace(re, '');
};



PreviousNext

Related