lua-users home
lua-l archive

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


On Mon, 18 Apr 2011 12:07:56 -0500, Rob Hoelz <rob@hoelz.ro> wrote:
>Also, you're using the for loop wrong.  For iterating over each line in
>a string, you'd probably use string.gmatch; for a table, try ipairs or
>pairs.

Thanks but why is it better to use string.gmatch() instead of
io.lines()? In this case, there's only one item per line.