JavaScript string replacement problem -


I am substituting some string on the text, I am coming back from a JSON web service, the string can look like this Is:

  "Hello I am a string. \ R \ nIt is a second line. \ R \ n \ r \ nIt is a big place"  

I want to replace \ r \ n with
so that HTML is formatted, but when I do:

< Previous> var string = result.replace ('\ r \ n', '

I have not been able to find just the first example, no other

What am I doing?

  var string = result. Rale (/ \ r \ n / g, '& Lt; br / & gt; ');  

Comments