JQuery 去除字符串两边多余的空格

var str = "  hello  ";

str = $.trim(str);//去除多余空格

//变成了"hello"

posted @ 2013-12-10 08:33  无忧之路  阅读(503)  评论(0编辑  收藏  举报
无忧之路