Differenze tra le versioni di "Modulo:Wikilib"

nessun oggetto della modifica
 
w.trim = string.trim
 
-- Rende maiuscola la prima lettera di una stringa
 
string.first_uppercase = function(s)
return s:sub(1,1):upper() .. s:sub(2)
end
w.first_uppercase, string.fu = string.first_uppercase, string.first_uppercase
 
-- Rende possibile la string interpolation in stile Python
 
string.interp = function(s, tab)
return (s:gsub('($%b{})', function(w) return tab[w:sub(3, -2)] or w end))
end