I want to remove carriage return and space from a string for exemple:
var t =" \n \n aaa \n bbb \n ccc \n";
I want to have as result:
t = "aaa bbb ccc"
I use this one, it removes carriage return but I still have spaces
t.replace(/[\n\r]/g, '');
Please someone help me.
/[\s\n\r]/g
\n
and\r
if\s
already matches them?