Reputation: 2244
I'm trying to remove all escape characters returned from this steam json
tings_block\">\r\n\t\t\t<div class=\"market_listing_right
i'm trying to pull out the \r and \n so i'm left with
tings_block"><div class="market_listing_right
When I try
[^\\r]
It pulls out the backslashes but it also pulls out all the other r's that aren't next to a backslash. How can I achieve this?
Upvotes: 0
Views: 60
Reputation: 5038
This would remove all \r
, \n
, \t
and all simple \
in your string.
var regex = /\\[rnt]?/g;
str.replace(regex, "");
Upvotes: 2