Utf8.next

From GiderosMobile
Revision as of 10:02, 23 August 2018 by Hgy29 (talk | contribs) (Created page with "__NOTOC__ '''Available since:''' Gideros 2016.06<br/> === Description === Iterate though the UTF-8 string s. If only s is given, it can used as a iterator: for pos, code in ut...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2016.06

Description

Iterate though the UTF-8 string s. If only s is given, it can used as a iterator: for pos, code in utf8.next, "utf8-string" do -- ... end if only charpos is given, return the next byte offset of in string. if charpos and offset is given, a new charpos will calculate, by add/subtract UTF-8 char offset to current charpos. in all case, it return a new char position (in bytes), and code point (a number) at this position.

(varies), = utf8.next(scharposoffset,)

's: (string) '
charpos: (number) optional
offset: (number) optional
Returns (varies) next iteration