String.prototype.len = function() {
return this.replace(/[^\x00-\xff]/g, 'xx').length;
};
alert("文字abc".len());
取自 http://topic.youkuaiyun.com/u/20090825/09/e4012e42-d3fe-4e46-8b4d-ff6d1e1bc5c5.html
String.prototype.len = function() {
return this.replace(/[^\x00-\xff]/g, 'xx').length;
};
alert("文字abc".len());
取自 http://topic.youkuaiyun.com/u/20090825/09/e4012e42-d3fe-4e46-8b4d-ff6d1e1bc5c5.html