javascript正则表达式取汉字的长度,一个汉字占两个字节长度

<html> <body> <script language="javascript"> String.prototype.len=function(){return this.replace(/[^/x00-/xff]/g,"aa").length;}javascript function test() {  alert("中国aa".len()) ;  html } </script> <in
相关文章
相关标签/搜索