NewLine(\n) alternative in Lua?

Viewed 18484

I'm looking for an alternative way to express new line(\n) in Lua since my host application doesn't allow users to use \ character.

Here's my code:

local str = "Hello\nWorld"
print(str)

Is there any alternative solution to make the same string without using \n character?

1 Answers

You can enter newlines directly into the string using long strings:

local str = [[Hello
World]]
Related