lua-users home
lua-l archive

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

I think Roberto originally gave the trick to take also the last partial line in:

	for line in (lines.."\n"):gmatch"(.-)\n" do
		io.write(">>", line, "<<\n")


Mark Edgar kirjoitti 3.7.2007 kello 1:22:

for line in lines:gmatch"(.-)\n" do
io.write(">>", line, "<<\n")

However, this misses the last (partial) line in cases where 'lines'
does not end in a newline.