去掉字符串前后所有空格

去掉字符串前后所有空格

function Trim(str)
 { 
  return str.replace(/(^s*)|(s*$)/g, ""); 
}
原文地址:https://www.cnblogs.com/zxyun/p/9268095.html