标签:style c class blog code java
//判断一个汉子等于两个字符 function getByteLen(val) { var len = 0; for (var i = 0; i < val.length; i++) { var a = val.charAt(i); if (a.match(/[^\x00-\xff]/ig) != null) { len += 2; } else { len += 1; } } return len; }
标签:style c class blog code java
原文地址:http://www.cnblogs.com/mingxuantongxue/p/3746144.html