Module:Sandbox/Element10101/Hymenoptera

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
local p = {}

function split (inputstr, sep)
    -- if sep is null, set it as space
    if sep == nil then
        sep = '%s'
    end
    -- define an array
    local t = {}
    -- split string based on sep   
    for str in string.gmatch(inputstr, '([^'..sep..']+)') 
    do
        -- insert the substring in table
        table.insert(t, str)
    end
    -- return the array
    return t
end

p.hymenoptera = function (frame)
	local table = frame:expandTemplate { title = "Wikipedia:WikiProject Insects/Hymenoptera task force/todo/taxa", args = {} }
	table = split (table, "Complete?")[2]
	return table
end

return p