Difference between revisions of "String.len"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== Description ===
 
=== 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.
 
Receives a string and returns its length. The empty string "" has length 0. Embedded zeros are counted, so "a\000bc\000" has length 5.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(number) = string.len(s)
 
(number) = string.len(s)
 
</source>
 
</source>

Revision as of 14:31, 13 July 2023

Available since: Gideros 2011.6
Class: string

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. <syntaxhighlight lang="lua"> (number) = string.len(s) </source>

Parameters

s: (string) string for which to measure length

Return values

Returns (number) the length of the string