Home  Contents

string.len

String Lua Commands

SYNOPSIS

string.len(s)

DESCRIPTION

Receives a string and returns its length. The empty string "" has length 0. Embedded zeros are counted, so "a\000bc\000" has length 5.

RETURN VALUE

Returns the length of the string as number.

EXAMPLE

print(string.len("test"))
4