Jump to content

Module:If empty

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Codehydro (talk | contribs) at 18:42, 23 December 2014 (oh, misread doc; thought opposite purpose for template). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

-- 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 not string.len(args[i]) do
		i = i + 1
	end
	return args[i]
end
return p