一个中文作为两个字符,一个数字或者字母作为一个字符来算
var str = "01abc23中文4567中ad文89中文";
str=str.replace(/[^\x00-\xff]/g,"$&\x01").replace(/.{10}\x01?/g,"$&\n").replace(/\x01/g,"");
alert(str);
var str = "01abc23中文4567中ad文89中文";
str=str.replace(/[^\x00-\xff]/g,"$&\x01").replace(/.{10}\x01?/g,"$&\n").replace(/\x01/g,"");
alert(str);