/
Lua Strings

Lua Strings

This is a Lua string:

local AString = "This is a string"

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 declaring a multiline string.

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

The same syntax can be used with comments:

-- A single line comment. --[[ A multiple line comment! ]]

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

 

Related content

Long term support
Long term support
Read with this
Comments
More like this
The socket C10K problem
The socket C10K problem
Read with this
Trimming white space
Trimming white space
More like this
Think of curl as a code dump
Think of curl as a code dump
Read with this
String:match()
String:match()
More like this