摘要: 1.//字符串长度-中文和全角符号为1,英文、数字和半角为0.5var getLength = function(str, shortUrl) { if (true == shortUrl) { // 一个URL当作十个字长度计算 return Math.ceil(str.replace(/((news|telnet|nttp|file|http|ftp|https):\/\/){1}(([-A-Za-z0-9]+(\.[-A-Za-z0-9]+)*(\.[-A-Za-z]{2,5}))|([0-9]{1,3}(\.[0-9]{1,3}){3}))(:[0-9... 阅读全文
posted @ 2013-11-28 16:30 幻星宇 阅读(480) 评论(0) 推荐(1) 编辑