lua string length
-- Strings are immutable. Immutable simply means unmodifiable or unchangeable.
a = 'this is a string'
3.5
6
-- One can get the length of a string by using the # (length) operator.
-- The metamethod for this operator is __len.
local str = "Hello world!";
print(#str); -- 5
Thank you!
6
0
Are there any code examples left?
New code examples in category Lua