From Data Realms Wiki
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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