How to detect '\n' in HTML. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to detect '\n' in HTML.

I am working on Django. Let suppose if user input like this :- hello man Here is \n new line character in this string but when i print this string in html i got output like this hello man How i can add new line html if I got \n in string. I know about <br/> but here am working in Django and i want to print new line in html through Django.

1st Oct 2019, 4:45 PM
Maninder $ingh
Maninder $ingh - avatar
1 Answer
0
There are two ways: You can use the string inside a <pre> tag. Or you can replace "\n" with "<br>" P.s: You have sent this question three time. Please delete the other two ones
1st Oct 2019, 5:31 PM
ΛM!N
ΛM!N - avatar