Monday, May 20, 2024
40
rated 0 times [  42] [ 2]  / answers: 1 / hits: 25202  / 11 Years ago, wed, february 5, 2014, 12:00:00

I'm pulling in some data from an api and console.log in chrome:



Chrome prints it like
asdföklajsd↵New line!



I would like to replace the ↵ character with a <br /> using replace in javascript. How do I reference that character?


More From » google-chrome

 Answers
6

It's a return character.



Try replacing them like this:



myString = myString.replace(/(rn|n|r)/gm, <br />);

[#72712] Tuesday, February 4, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sonja

Total Points: 541
Total Questions: 113
Total Answers: 114

Location: Anguilla
Member since Sun, Jan 29, 2023
1 Year ago
sonja questions
Mon, Nov 30, 20, 00:00, 4 Years ago
Sun, Oct 11, 20, 00:00, 4 Years ago
Thu, May 21, 20, 00:00, 4 Years ago
Sun, Nov 10, 19, 00:00, 5 Years ago
Mon, Aug 26, 19, 00:00, 5 Years ago
;