lua-users home
lua-l archive

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



Yes, exactly. :)

It probably does the job, but -honestly- I've never even used 'gfind' before.. The point is, Lua should be intuitive and straightforward, and "for line in string.lines(str)" was the first thing I'd try just by guessing..

In fact, why have separate 'string.lines()' and 'io.lines()'. Just 'lines()' as there's currently 'pairs()' and 'ipairs()' would do!

It's not the question it couldn't be done (I already did, with a clumsy for loop). It's a question on how cleanly it could be done. Sorry to say :) but your example looks like Perl.. (no offense)

-ak


28.7.2004 kello 01:41, Jamie Webb kirjoitti:

 Won't string.gfind("[^\n]+") do?