Reputation: 1151
In Python, for example, one can break line with '\' character (yeah, necessary evil). Is it possible to break lines in Elixir?
Upvotes: 20
Views: 11232
Reputation: 4484
Based on Jose Valim comment.
iex(1)> "hello\
...(1)> world"
"helloworld"
iex(2)>
Upvotes: 9
Reputation: 16781
Elixir is not as whitespace-sensitive as Python, so you can do things like:
a =
2 + 4 +
3
# a is bound to 9
If you want to break strings, probably your best shot is to concatenate one string per line:
"this is a very long string that " <>
"spans multiple lines because man, " <>
"is it long"
Upvotes: 24