Javascript String stripExcessSpaces()

Description

Javascript String stripExcessSpaces()

String.prototype.stripExcessSpaces = function() {
  return this.replace(/\s+/g,' ').trim();
};

module.exports = String;// w w  w. ja  va 2s  . com



PreviousNext

Related