Module:RemoveCountySuffix: Difference between revisions

From Trans People Together Wiki
No edit summary
No edit summary
Line 4: Line 4:
function p.replace(frame)
function p.replace(frame)
     local str = frame.args[1]
     local str = frame.args[1]
     local pattern = '| County, ' .. frame.args[2]
     local pattern = ' County, ' .. frame.args[2] .. ']]'
     local replacement = ''
     local replacement = ']]'
     return mw.ustring.gsub(str, pattern, replacement)
     return mw.ustring.gsub(str, pattern, replacement)
end
end


return p
return p

Revision as of 10:54, 14 May 2025

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

-- Module:Replace
local p = {}

function p.replace(frame)
    local str = frame.args[1]
    local pattern = ' County, ' .. frame.args[2] .. ']]'
    local replacement = ']]'
    return mw.ustring.gsub(str, pattern, replacement)
end

return p