Javascript String sizeTo(len, chr)

Description

Javascript String sizeTo(len, chr)

String.prototype.sizeTo = function(len, chr) {
  return (this + new Array(len + 1).join(chr || ' ')).substr(0, len);
}



PreviousNext

Related