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零
  • 3,795
  • 9
  • 41
  • 81

1 Answers1

5

Add a \ backslash to the end of every line:

var string = "Hello\
              world\
              this\
              is\
              a string!";
Bojangles
  • 96,145
  • 48
  • 166
  • 203