Module:String2: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Content added Content deleted
(debug)
(don't trim the separator)
Line 76: Line 76:
p.findlast = function(frame)
p.findlast = function(frame)
local s = mw.text.trim( frame.args[1] or "" )
local s = mw.text.trim( frame.args[1] or "" )
local sep = mw.text.trim( frame.args[2] or ", " )
local sep = frame.args[2] or ""
local pattern = ".*" .. ", " .. "(.*)"
if sep == "" then sep = ", " end
local pattern = ".*" .. sep .. "(.*)"
a, b, last = s:find(pattern)
a, b, last = s:find(pattern)
if a then
if a then