lua-users home
lua-l archive

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


> I wanted:
> 1 : cou
> 2 : cou2
> 3 : co
> u3
> 4 : cou4

The code below does that.

t="cou   cou2 co\nu3   cou4    ";
local i=0
for w in t:gmatch("[^ ]+") do
	i=i+1
	print(i,w)
end