摘要: function(s){ return Math.ceil(s.replace(/[\u4e00-\u9fa5]/g, 'xx').length / 2);}也可以用(/[^\x00-\xff]/g,'**'),这个是用'**'替换双字节字符(/[\u4e00-\u9fa5]/g, '**') 这个是用'**'替换中文字符,\u4e00-\u9fa5中文的unicode编吗 阅读全文
posted @ 2012-07-18 12:56 沫鱼 阅读(2759) 评论(1) 推荐(0) 编辑