Javascript does not provide a trim() function so you would have to make on yourself. You can use this nifty pre-made function.

Related Posts Plugin for WordPress, Blogger...