Difference between revisions of "Module:YearStrip"

From WikiConference North America
Jump to navigation Jump to search
(Working)
(Working)
 
Line 2: Line 2:
   
 
function p.YearStrip(pagename)
 
function p.YearStrip(pagename)
local output = string.gsub(pagename.args[0], "[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