lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Op Do. 16 Mei 2019 om 17:58 het Paul K <paul@zerobrane.com> geskryf:
>
> Hi Dirk,
>
> >      for p, c in string.bytes(s) do body end
> > will iterate over all bytes in string s, with p being the position.
> > This is surprisingly clumsy in pure Lua, unless I am missing a trick.
>
> `s:gmatch("()(.)")`? Or am I missing something?
>
> Paul.

Perfect. I'll withdraw the "surprisingly clumsy" now.