Difference between revisions of "Utf8.len"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2016.06<br/> === Description === Returns the number of UTF-8 characters in string s that start between positions i and j (both inclusi...")
 
Line 4: Line 4:
 
Returns the number of UTF-8 characters in string s that start between positions i and j (both inclusive). The default for i is 1 and for j is -1. If it finds any invalid byte sequence, returns a false value plus the position of the first invalid byte.
 
Returns the number of UTF-8 characters in string s that start between positions i and j (both inclusive). The default for i is 1 and for j is -1. If it finds any invalid byte sequence, returns a false value plus the position of the first invalid byte.
 
<source lang="lua">
 
<source lang="lua">
(number), = utf8.len(sij,)
+
(number) = utf8.len(s,i,j)
 
</source>
 
</source>
'''s:''' (string)  ''''''<br/>
+
'''s''': (string)  ''''''<br/>
'''i:''' (number)  '''optional'''<br/>
+
'''i''': (number)  '''optional'''<br/>
'''j:''' (number)  '''optional'''<br/>
+
'''j''': (number)  '''optional'''<br/>
 
'''Returns''' (number) number of characters<br/>
 
'''Returns''' (number) number of characters<br/>

Revision as of 11:16, 23 August 2018

Available since: Gideros 2016.06

Description

Returns the number of UTF-8 characters in string s that start between positions i and j (both inclusive). The default for i is 1 and for j is -1. If it finds any invalid byte sequence, returns a false value plus the position of the first invalid byte.

(number) = utf8.len(s,i,j)

's: (string) '
i: (number) optional
j: (number) optional
Returns (number) number of characters