From Data Realms Wiki
Usage
String.len returns the length of any given string.
Example:
string = "Hello, world!"
print(string.len(string))
Example 2:
string = "Hello, world!"
if string.len(string) < 5 then -- "if the length of 'string' is lesser than five, then"...
print("The string's length is lesser than five.")
else -- "else" or "otherwise"...
print("The string's length is greater than five.")
end