方法1 使用正则 (如果是汉字,此正则,每五个字换行,如果是英文字符,每十个英文,换行) let arrX ="这是个测试字符串,这是个测试字符串" arrX?=?arrX.replace(/[^\x00-\xff]/g,"$&\x01").replace(/.{10}\x01?/g,"$&\n").replace(/\x01/g,"") ? 方法2 循环遍历 let res = "" let?arrX ="这是个测试字符串,这是个测试字符串" for(let i=0,j=1; i<arrX.length; i++, j++) {if(j&&j%6 === 0) {res +=?'<br />'} else {res +=??arrX[i]} }...