| -------------------------------------------------------------- 去掉字符串头尾多余的空格 /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" ##利用正则表达式限制网页表单里的文本框输入内容: -------------------------------------------------------------- -------------------------------------------------------------- -------------------------------------------------------------- -------------------------------------------------------------- |

- 本文固定链接: https://zxbcw.cn/post/1767/
- 转载请注明:必须在正文中标注并保留原文链接
- QQ群: PHP高手阵营官方总群(344148542)
- QQ群: Yii2.0开发(304864863)