10

Убрать пробельные символы из начала и конца строки

var str = "         lots of spaces before and after         ";
console.log('"'+$.trim(str)+'"');
"lots of spaces before and after"
-----------