lua-users home
lua-l archive

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


> You can make it so just an empty string is pushed if there is at least
> one newline:
> 
> local n = select(2, s:gsub("[^\n]*\n[^\n]*", ""))

Or this:
	local _,n = s:gsub('.-\n', '')