Re: finding keys in a table
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: finding keys in a table
- From: Mike Pall <mikelu-0802@...>
- Date: 2008年2月21日 16:28:24 +0100
local t = setmetatable({}, { __index = function() return 0 end })
for c in string.gmatch(io.read("*a"), ".") do t[c] = t[c] + 1 end
table.foreach(t, print)
--Mike