Trim string from both side - Node.js String

Node.js examples for String:Trim

Description

Trim string from both side

Demo Code


String.prototype.trim = function(){   
  return this.replace(/(^\s*)|(\s*$)/g, "");
};

Related Tutorials