javascript判断字符长度最好的方法

function getlengthB(str){
     return str.replace(/[^\x00-\xff]/g,"**").length;
     }

原文地址:https://www.cnblogs.com/zwh/p/480152.html