日期:2014-05-16 浏览次数:20444 次
var a = "不1会2写3作a业b就c来d问e下f我4",
reg = /[[\u4e00-\u9fa5]/g,
bytes = a.match(reg).length + a.length;
alert(bytes);
------解决方案--------------------
var a = "不1会2写3作a业b就c来d问e下f我4",
reg = /[[\u4e00-\u9fa5]/g,
bytes = a.match(reg).length + a.length;
alert(bytes);