javascript中汉字长度算为2

ls_val.replace(/[^\x00-\xff]/g, "aa").length

原文地址:https://www.cnblogs.com/kuailewangzi1212/p/3025863.html