Type Function Library string.* Return value Number Revision Release 2024.3703 Keywords string, len, length, string length See also String
Returns the length of a string (amount of characters).
If you’re using encoded UTF-8 characters, for example Russian or Arabic characters, some of these characters are string.len()
. Please see here for more information on
string.len( s ) s:len()
String. Any string.
print( string.len( "Lua" ) ) --> 3 print( string.len( "" ) ) --> 0 print( string.len( "Lua\000user" ) ) --> 8