-------------------------------------------------------------- 去掉字符串头尾多余的空格 /g是全文查找所有匹配function String.prototype.Trim(){return this.replace(/(^\s*)|(\s*$)/g, "");}function String.prototype.LTrim(){return this.replace(/(^\s*)/g, "");} function String.prototype.RTrim(){return this.replace(/(\s*$)/g, "");} -------------------------------------------------------------- String.prototype.len=function(){return this.replace([^\x00-\xff]/g,"aa").length;} -------------------------------------------------------------- String.prototype.trim = function() s="http://www.9499.net/page1.htm" ##利用正则表达式限制网页表单里的文本框输入内容: -------------------------------------------------------------- -------------------------------------------------------------- -------------------------------------------------------------- -------------------------------------------------------------- |
扫码二维码 获取免费视频学习资料
- 本文固定链接: http://www.phpxs.com/post/1767/
- 转载请注明:转载必须在正文中标注并保留原文链接
- 扫码: 扫上方二维码获取免费视频资料