Module:ModuleUniqueStatTable: Difference between revisions

From The First Descendant Wiki
No edit summary
No edit summary
Line 17: Line 17:


     local result = ""
     local result = ""
     for i, part in ipairs(parts) do
     for i, part in ipairs(splitArray) do
         result = result .. "####" .. part
         result = result .. "####" .. part
     end
     end

Revision as of 06:14, 5 June 2024

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

local p = {}

local splitArray = {}

local function split(str)
    splitArray = {}
    for match in (str.."@"):gmatch("(.-)".."@") do
        table.insert(splitArray, match)
    end
end

function p.processData(frame)
    if frame.args.csv == nil then
        return "ERROR: Module:ModuleUniqueStatTable got no csv string! Please tell us on Discord!"
    end
    split(frame.args.csv)

    local result = ""
    for i, part in ipairs(splitArray) do
        result = result .. "####" .. part
    end
    return result
end

return p