RogerDodger (talk | contribs) No edit summary |
RogerDodger (talk | contribs) No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 4: | Line 4: | ||
local s = frame.args[1] | local s = frame.args[1] | ||
return s:lower() | return s:lower() | ||
end | |||
p.match = function(frame) | |||
local s = frame.args[1] | |||
return s:match(frame.args[2], frame.args[3], frame.args[4]) | |||
end | end | ||
Line 10: | Line 15: | ||
local n = frame.args[2] | local n = frame.args[2] | ||
return s:rep(n) | return s:rep(n) | ||
end | |||
p.trim = function(frame) | |||
local s = frame.args[1] | |||
return mw.text.trim(s) | |||
end | end | ||
return p | return p |
Latest revision as of 14:24, 3 March 2024
Documentation for this module may be created at Module:String/doc
local p = {};
p.lc = function(frame)
local s = frame.args[1]
return s:lower()
end
p.match = function(frame)
local s = frame.args[1]
return s:match(frame.args[2], frame.args[3], frame.args[4])
end
p.rep = function(frame)
local s = frame.args[1]
local n = frame.args[2]
return s:rep(n)
end
p.trim = function(frame)
local s = frame.args[1]
return mw.text.trim(s)
end
return p