Reputation: 3044
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?
Upvotes: 6
Views: 36860
Reputation: 72312
You can enter newlines directly into the string using long strings:
local str = [[Hello
World]]
Upvotes: 8