摘要:
/*** description : 得到字符串的字节长度;* @version 0.2;* @return 返回字符串的字节长度(eg:"一二12"的字节长度是6);*/String.prototype.getLength=function(){var text=this.replace(/[^\x00-\xff]/g,"**");return text.length;}/*** description : 按字节长度截取字符串,并添加后缀.* @param len 需要截取的长度,字符串长度不足返回本身;* @param alt 添加后缀(非必要), 阅读全文
posted @ 2011-06-10 02:37
星火卓越
阅读(3053)
评论(0)
推荐(0)