0
Why this "\n" doesn't create line break in Vscode? But it create a line break in sololearn?
10 Réponses
+ 2
Can you share the code which you have written in Vs code ide?
+ 1
I guess that if you run you code locally under window, new lines require "\n\r" (or "\r\n", doesn't remember)...
I guess also that in C++ endl should output platform agnostic right new line sequence ;)
+ 1
visph yes I have a new line
Thanks a lot
0
СОБАКА => Дебил / Retard on JS
0
visph this create space between the words on JS (using vs code
0
Atul how can I share it?
0
are you writting html document?
if so, that's the normal behavior of almost all elements to be rendered by transforming new lines to spaces and compress multispaces to once...
pre-formatted text should be wrapped inside <pre> tag to correctly render line breaks, or style it with css white-space property set to pre or pre-wrap...
0
visph I have linked a JS file with my html file
It's not in the html file
0
yes, but is the js file wich output '\n' changed to spaces? probably because you're outputting it inside the html... what if you make an alert('hello\nworld'); did you get the new line?