JavaScript Recorte Newline
str = str.replace(/^\s+|\s+$/g, '');
Friendly Hawk
str = str.replace(/^\s+|\s+$/g, '');