Module:ContainsString

From Trans People Together Wiki
Revision as of 17:22, 8 May 2025 by Admin (talk | contribs)

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

-- Module:Contains
local p = {}

-- Usage in wikitext: {{#invoke:ContainsString|contains|<full text>|<substring>}}
function p.contains(frame)
    local text   = frame.args[1] or ''
    local sub    = frame.args[2] or ''
    -- plain-text (no pattern) find
    if mw.ustring.find(text, sub, 1, true) then
        return true
    else
        return false
    end
end

return p