var str='a b ad ';
str.replace(/[ ]/g, "");//去除所有的空格
var str='"13"23"';str.replace(/^\"|\"$/g,'');//去除str 前后的双引号
输出为:13"23