|
local t = {}
for t in string.gmatch(str, "%w+") do
t[#t + 1] = k
end
I know the lua_createtable can do this thing, but it will call C function.
so is the possible add some support in lua?
local t = {(100, 0)} -- give t 100 array capacity
for t in string.gmatch(str, "%w+") do
t[#t + 1] = k
end