2014
11-11
11-11
正则表达式在JavaScript应用
--------------------------------------------------------------去掉字符串头尾多余的空格/g是全文查找所有匹配functionString.prototype.Trim(){returnthis.replace(/(^\s*)|(\s*$)/g,"");}functionString.prototype.LTrim(){returnthis.replace(/(^\s*)/g,"");}functionString.prototype.RTrim(){returnthis.replace(/(\s*$)/g,"");}--------------------------------------------------------------应用:计...
继续阅读 >