TableA = {8,9,1,9,8,7,5,6,3,2,1,2,3,8,9,6,4}
function TableUnique(t)
local check = {}
local n = {}
for key, value in pairs(t) do
if not check[value] then
n[key] = value
check[value] = value
end
end
return n
end
for key, value in pairs(TableUnique(TableA)) do
print("value is:"..value)
end
网友评论