JavaScript - multi-line text

by Subramanian 2012-09-14 12:08:10

var text = <>
this
is
my
multi-line
text
.toString();
Print(text);


Prints :

this
is
my
multi-line
text


note

If you want to support special XML chars, you can use a CDATA section:

<>
>>> hello

]]>.toString();

Tagged in:

391
like
0
dislike
0
mail
flag

You must LOGIN to add comments