0

Possible Duplicate:
How to create multiline strings

In c# I can do this:

string str = @"asd 
dsa 
blah blah blah";

How can i do the same in JavaScript? + every string is bad idea...

Community
  • 1
  • 1
Kosmo零
  • 4,001
  • 9
  • 45
  • 88

1 Answers1

5

Add a \ backslash to the end of every line:

var string = "Hello\
              world\
              this\
              is\
              a string!";
Bojangles
  • 99,427
  • 50
  • 170
  • 208