Question #8
Submitted by Answiki
on 04/29/2020 at 05:51:12 PM UTC
In Javascript, how to remove carriage return from string?
Merged questions
Answer
Submitted by Answiki
on 04/29/2020 at 05:54:48 PM UTC
In JavaScript, to remove carriage return from string, use the following regex str.replace(/[\n\r]/g, '');
as on the following example :
var str="abc \n def \r ghi";
// Should change str for "abc def ghi"
str.replace(/[\n\r]/g, '');
Question by Answiki 04/29/2020 at 05:55:05 PM
In JS, how to remove carriage return from string?
Answer by Answiki on 04/29/2020 at 05:54:48 PM
In JavaScript, to remove carriage return from string, use the following regex str.replace(/[\n\r]/g, '');
as on the following example :
var str="abc \n def \r ghi";
// Should change str for "abc def ghi"
str.replace(/[\n\r]/g, '');
Question by Answiki 04/29/2020 at 05:51:12 PM
In Javascript, how to remove carriage return from string?
# | ID | Query | URL | Count |
---|---|---|---|---|
0 | 13456 | alphons | https://en.ans.wiki/8/in-javascript-how-to-remove-carriage-return-from-string | 1 |
1 | 12448 | en | https://en.ans.wiki/8/in-javascript-how-to-remove-carriage-return-from-string | 7 |
Icons proudly provided by Friconix.