应用:计算字符串的长度(一个双字节字符长度计2,ASCII字符计1) String.prototype.len=function(){return this.replace(/[^x00-xff]/g,"aa").length;}

应用:计算字符串的长度(一个双字节字符长度计2,ASCII字符计1) String.prototype.len=function(){return this.replace(/[^x00-xff]/g,"aa").length;}

原文地址:https://www.cnblogs.com/wangc04/p/8459403.html