Module:LinkUtil: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
No edit summary
No edit summary
Line 5: Line 5:
     -- don't return second values
     -- don't return second values
     local ret = str:gsub('_', ' '):gsub('%s*%(.*%)','')
     local ret = str:gsub('_', ' '):gsub('%s*%(.*%)','')
    return ret
end
-- based on the above
function p.stripSMW(str)
    local ret = str:gsub('|.*%]%]',''):gsub('%[%[:',''):gsub('_', ' '):gsub('%s*%(.*%)','')
     return ret
     return ret
end
end


return p
return p

Revision as of 19:38, 30 November 2021

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

local p = {} --p stands for package

-- from https://lol.fandom.com/wiki/Module:EsportsUtil
function p.stripDab(str)
    -- don't return second values
    local ret = str:gsub('_', ' '):gsub('%s*%(.*%)','')
    return ret
end

-- based on the above
function p.stripSMW(str)
    local ret = str:gsub('|.*%]%]',''):gsub('%[%[:',''):gsub('_', ' '):gsub('%s*%(.*%)','')
    return ret
end

return p