Node.js examples for String:Trim
Trim a string by replacing string with regex
function _trim(str) { return str.replace(/^\s+/, '').replace(/\s+$/, ''); }