标签:style blog color io ar for div cti log
function strLength(str){ var time1 = new Date; if(str.length == 0 || !str) return null; var l = str.length; for(var i = 0; i< str.length; i++){ if(str.charCodeAt(i) > 255) l++; } console.log("耗时:" + (new Date - time1) + " 毫秒"); return l; } console.log(strLength(str));
标签:style blog color io ar for div cti log
原文地址:http://www.cnblogs.com/leejersey/p/3951627.html