Javascript String stripNewlines()

Description

Javascript String stripNewlines()

String.prototype.stripNewlines = function() {
  return this.replace(/\r?\n|\r/g, '');
};

Javascript String stripNewlines()

String.prototype.stripNewlines = function() {
    return this.replace(/[\n\r]/g,"");
}



PreviousNext

Related