I need to replace a \n\r
from a string multiple times. I managed to replace the first occurrence, but it doesn't work for more than one time. Something is not right with the escaping. I've tried:
$ node
> 'string\n\rstring\n\r'.replace('\n\r', '');
'stringstring\n\r'
> 'string\n\rstring\n\r'.replace('/\n\r/g', '');
'string\n\rstring\n\r'
> 'string\n\rstring\n\r'.replace('/\\n\\r/g', '');
'string\n\rstring\n\r'
> 'string\n\rstring\n\r'.replace('/\\\n\\\r/g', '');
'string\n\rstring\n\r'
> 'string\n\rstring\n\r'.replace('/\\\\n\\\\r/g', '');
'string\n\rstring\n\r'
How do I get stringstring
?