Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the ↵–character in chrome console?

Tags:

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?

like image 909
Himmators Avatar asked Feb 05 '14 09:02

Himmators


People also ask

What is VM in Chrome console?

It is abbreviation of the phrase Virtual Machine. In the Chrome JavaScript engine (called V8) each script has its own script ID. Sometimes V8 has no information about the file name of a script, for example in the case of an eval .

How do you run a code in chrome console?

Open Chrome, press Ctrl+Shift+j and it opens the JavaScript console where you can write and test your code.

How do I clear the Inspect Element console?

Use the short cut Ctrl + L to clear the console. Use the clear log button on the top left corner of the chrome dev tools console to clear the console. On MacOS you can use Command + K button.


1 Answers

It's a return character.

Try replacing them like this:

myString = myString.replace(/(\r\n|\n|\r)/gm, "<br />"); 
like image 135
Cerbrus Avatar answered Sep 20 '22 12:09

Cerbrus