Jump to content

Module:LowercaseFirstLetter

From Wikipedia, the free encyclopedia

local p = {}

function p.getModifiedTitle(frame)
    local title = mw.title.getCurrentTitle().text

    local rest = mw.ustring.sub(title, 2)
    if mw.ustring.find(rest, "%u") then
        return title
    else
        local first = mw.ustring.sub(title, 1, 1):lower()
        return first .. rest
    end
end

return p