Difference between revisions of "Module:YearStrip"

From WikiConference North America
Jump to navigation Jump to search
(Created page with "local p = { } function p.YearStrip(pagename) local output = string.gsub(pagename, "[0-9][0-9][0-9][0-9]%/", nil) return output end return p")
 
(Working)
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
   
 
function p.YearStrip(pagename)
 
function p.YearStrip(pagename)
local output = string.gsub(pagename, "[0-9][0-9][0-9][0-9]%/", nil)
+
local output = string.gsub(pagename.args[1], "[0-9][0-9][0-9][0-9]%/", "", 1)
 
return output
 
return output
 
end
 
end

Latest revision as of 08:18, 30 January 2015

Documentation for this module may be created at Module:YearStrip/doc

local p = { }

function p.YearStrip(pagename)
	local output = string.gsub(pagename.args[1], "[0-9][0-9][0-9][0-9]%/", "", 1)
	return output
end

return p