Re: Removing holes from a list
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Removing holes from a list
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: 2015年9月26日 12:44:01 -0300
Try this:
list=table.pack(1,2,3,nil,4,5,nil,nil,6,7)
local n=0
for i=1,list.n do
if list[i]~=ni then
n=n+1
list[n]=list[i]
end
end
list.n=n
for k,v in ipairs(list) do print(k,v) end