javascript字符串trim的实现

使用正则表达式加上字符串对象的replace函数来实现trim功能。

$("#streamid").val().replace(/(^[\\s]*)|([\\s]*$)/g, "")

原文地址:https://www.cnblogs.com/k1988/p/2165586.html