Moduł:Narzędzia: Różnice pomiędzy wersjami
Z Nonsensopedii, polskiej encyklopedii humoru
Ostrzyciel (dyskusja • edycje) M |
Ostrzyciel (dyskusja • edycje) M |
||
Linia 1: | Linia 1: | ||
local p = {} |
local p = {} |
||
function p. |
function p.firstSmall(frame) |
||
return p. |
return p._firstSmall(frame.args[1]) |
||
end |
end |
||
function p. |
function p._firstSmall(text) |
||
if text == nil or text:len() == 0 then |
if text == nil or text:len() == 0 then |
||
return '' |
return '' |
||
Linia 15: | Linia 15: | ||
end |
end |
||
function p. |
function p.firstLarge(frame) |
||
return p. |
return p.firstLarge(frame.args[1]) |
||
end |
end |
||
function p. |
function p._firstLarge(text) |
||
if text == nil or text:len() == 0 then |
if text == nil or text:len() == 0 then |
||
return '' |
return '' |
Wersja z 16:31, 9 mar 2020
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