Module:Case

From Heroes 3 wiki
Revision as of 21:31, 22 May 2021 by Imahero (talk | contribs) (didn't notice there was a ucfirst built-in function)
Jump to navigation Jump to search

See usage on Script error: The function "title_case" does not exist., Lua error at line 8: attempt to call method 'ucfirst' (a nil value)., and template:l.


local p = {} --p stands for package

function p.lowercase(frame)
    return "[[" .. frame.args.link .. "|" .. string.lower(frame.args.link) .. "]]"
end

function p.uppercase_first_letter(frame)
    return "[[" .. frame.args.link .. "|" .. mw.language:ucfirst(frame.args.link) .. "]]"
end

return p