Module:If empty

Revision as of 19:02, 23 December 2014 by imported>Codehydro (Undid revision 639373039 by Codehydro (talk) appaarently I do)
Jump to navigation Jump to search

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

-- this is intended to replace {{If empty}}
local p = {};
function p.run(frame)
	local args = require('Module:Arguments').getArgs(frame)
	local i = 0
	args[table.getn(args)] = ''
	while args[i] == nil or string.len(args[i]) == 0 do
		i = i + 1
	end
	return args[i]
end
return p