Nodejs String Normalize normalize()

Here you can find the source of normalize()

Method Source Code

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

Related

  1. nominalize()
    String.prototype.nominalize = function() {
      return this.charAt(0).toUpperCase() + this.slice(1);
    };
    
  2. normalize()
    String.prototype.normalize = function () {
      return this.replace(/\W/g, "");
    
  3. normalize()
    String.prototype.normalize = function(){
        return this.replace(/\<[\/a-z \"=]*\>|\n/g,' ').toLowerCase();
    
  4. normalize(s)
    String.prototype.normalize = function(s) {
        return this.replace(new RegExp(s + "+", "gm"), s);
    };