Utf8.len: Difference between revisions
From GiderosMobile
No edit summary |
m Text replacement - "<source" to "<syntaxhighlight" |
||
| Line 5: | Line 5: | ||
=== <translate>Description</translate> === | === <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> | ||
< | <syntaxhighlight lang="lua"> | ||
(number) = utf8.len(s,i,j) | (number) = utf8.len(s,i,j) | ||
</source> | </source> | ||
Revision as of 13:32, 13 July 2023
Available since: Gideros 2016.06
Class: utf8
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. <syntaxhighlight lang="lua"> (number) = utf8.len(s,i,j) </source>
Parameters
s: (string)
i: (number) optional
j: (number) optional
Return values
Returns (number) number of characters