javascript去掉字符串中空格符的方法:1、使用replace()函数,语法“str.replace( , )”或“str.replace(正则表达式,"")”;2、使用trim()函数,语法“str.trim()