Difference between revisions of "Utf8.len"
From GiderosMobile
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | '''Available since:''' Gideros 2016.06<br/> | + | '''<translate>Available since</translate>:''' Gideros 2016.06<br/> |
− | === Description === | + | === <translate>Description</translate> === |
<translate>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.</translate> | <translate>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.</translate> | ||
<source lang="lua"> | <source lang="lua"> | ||
(number) = utf8.len(s,i,j) | (number) = utf8.len(s,i,j) | ||
</source> | </source> | ||
− | === Parameters === | + | === <translate>Parameters</translate> === |
'''s''': (string) <translate></translate> <br/> | '''s''': (string) <translate></translate> <br/> | ||
'''i''': (number) <translate></translate> '''optional'''<br/> | '''i''': (number) <translate></translate> '''optional'''<br/> | ||
'''j''': (number) <translate></translate> '''optional'''<br/> | '''j''': (number) <translate></translate> '''optional'''<br/> | ||
− | === Return values === | + | === <translate>Return values</translate> === |
− | '''Returns''' (number) <translate>number of characters</translate><br/> | + | '''<translate>Returns</translate>''' (number) <translate>number of characters</translate><br/> |
Revision as of 07:29, 24 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)
Parameters
s: (string)
i: (number) optional
j: (number) optional
Return values
Returns (number) number of characters