给文字加上着重号
var s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890';
function f(s, width){
return s.replace(
new RegExp('[\\s\\S]{1,'+(width || 4)+'}', 'g'),
function(m){
return '^' + new Array(m.length).join(' ');
});
}
console.log(s);
console.log(f(s, 4));
console.log(f(s, 8));
机器瞎学/数据掩埋/模式混淆/人工智障/深度遗忘/神经掉线/计算机幻觉/专注单身二十五年
浙公网安备 33010602011771号