javascript字符串trim的实现 使用正则表达式加上字符串对象的replace函数来实现trim功能。$("#streamid").val().replace(/(^[\\s]*)|([\\s]*$)/g, "")