Javascript String clean()

Description

Javascript String clean()


String.prototype.clean = function clean () {
  return this.replace(/ +/gi, ' ').trim();
};

Javascript String clean()

String.prototype.clean = function() {
    str = this.replace(/'/g, '').replace(/\s/g, '').replace(/_/g, '');
    return str;//from  w ww. j  av a  2s.c o  m
};



PreviousNext

Related