Answers for "lua string length"

Lua
-1

lua string length

-- 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
Posted by: Guest on December-31-2020
0

Lua string

-- Strings are immutable. Immutable simply means unmodifiable or unchangeable.
a = 'this is a string'
Posted by: Guest on December-03-2020

Browse Popular Code Answers by Language