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")
	end

;)

Mark Edgar kirjoitti 3.7.2007 kello 1:22:

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

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

    -Mark