July 2018
Beginner
202 pages
5h 42m
English
The miscellaneous operators presented here do not fit into any of the previous groups. These operators are Lua constructs.
The assignment operator (=) changes the value of a variable. This operator has been used many times up until this point. The assignment operator allows for multiple assignment. All of the following are valid:
x = 2y, z = 4, "hello"
The string concatenation operator (..) will combine two strings into a single string. This operator was covered in the String types section of this chapter. As a reminder, the syntax is:
hello = "hello,"world = " world"print (hello .. world)
Finally, the length operator (#) is a unary operator that will return the length of a string or a table. The use of this operator for strings ...
Read now
Unlock full access