js trim函数

function trimStr(str) 
 
var re = /\s*(\S[^\0]*\S)\s*/
 re.exec(str); 
 
return RegExp.$1
}
posted @ 2008-02-22 14:03  一瞬间  阅读(507)  评论(0编辑  收藏  举报