Trim string with regex - Node.js String

Node.js examples for String:Trim

Description

Trim string with regex

Demo Code


String.prototype.trim = function(){return
(this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, ""))}

Related Tutorials