<script>
String.prototype.len=function()
{
    return this.replace(/[^\x00-\xff]/g,"**").length;
}
var str="joycenter的字符串";
alert(str.len());
</script>