javscript 去除文字换行符
function transferString(content) { var string = content; try{ string=string.replace(/\r\n/g," ") string=string.replace(/\n/g," "); }catch(e) { alert(e.message); } return string; }
var str = transferString('sdfafda↵dfafafdsaf');
console.log(str);