Moduł:Narzędzia

Z Nonsensopedii, polskiej encyklopedii humoru

local p = {}

function p.firstSmall(frame)
    return p._firstSmall(frame.args[1])
end

function p._firstSmall(text)
    if text == nil or text:len() == 0 then
        return ''
    end
        
    text = string.sub(text, 1, 1):lower() .. string.sub(text, 2, -1)
    
    return text   
end

function p.firstLarge(frame)
    return p._firstLarge(frame.args[1])
end

function p._firstLarge(text)
    if text == nil or text:len() == 0 then
        return ''
    end
        
    text = string.sub(text, 1, 1):upper() .. string.sub(text, 2, -1)
    
    return text   
end

return p