Potong ruang di jQuery

var str = "       Hello World!        ";
alert(str.trim());
Unusual Unicorn