Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Lua supports a multiline form of declaring strings where you can start with the string with [[ and end it with ]]. This is analogous to Javascript literal notationdeclaring a multiline string.

Code Block
languagelua
local ALongString=[[
This is
a long
multiple line string.
]]

...

Code Block
languagelua
-- A single line comment.

--[[
A multiple line
comment!
]]

To find the length of a string we use the # operator:

Code Block
languagelua
local Length = #ALongString