Module:ImageGridFromList

From The First Descendant Wiki
Revision as of 17:11, 1 June 2024 by Software2 (talk | contribs) (Created page with "local p = {} function p.split(frame) local str = frame.args[1] local sep = frame.args[2] local pre = frame.args[3] local result = {} for match in (str..sep):gmatch("(.-)"..sep) do table.insert(result, pre .. match) end return table.concat(result, "\n") end return p")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:ImageGridFromList/doc

local p = {}

function p.split(frame)
    local str = frame.args[1]
    local sep = frame.args[2]
    local pre = frame.args[3]
    local result = {}

    for match in (str..sep):gmatch("(.-)"..sep) do
        table.insert(result, pre .. match)
    end

    return table.concat(result, "\n")
end

return p