Lua Programming/length operator

Length operator
The unary # symbol is used to obtain the length of a string or table. The length operator returns the number of bytes for strings. The length operator returns the last numeric key whose value is not nil for tables starting from 1. The length operator returns zero for tables when the first numeric key is nil or there are no numeric keys.

Note that the string library provides the string.len function, which can also be used to determine the length of a string: