标签:style blog color io ar for sp div on
function getStrLength(str){ var len = 0; for (var i = 0; i < str.length; i++) { var c = str.charCodeAt(i); //单字节加1 if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) { len++; }else { len += 2; } } return len; }
标签:style blog color io ar for sp div on
原文地址:http://www.cnblogs.com/hebin-javaemperor/p/3998714.html