js去除字符串中的空格

function trim(strToTrim) { return strToTrim.replace(/^\s+|\s+$/g, "") }

posted on 2009-10-04 13:31  画一个圆圈  阅读(130)  评论(0)    收藏  举报

导航