模块:If empty
<templatestyles src="Module:Message box/ombox.css"></templatestyles>
| Protected | This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
<templatestyles src="Module:Message box/ombox.css"></templatestyles>
| 文件:Lua-logo-nolabel.svg | 此-{zh-hans:模块; zh-hant:模組;}-使用Lua语言: |
<templatestyles src="Module:Message box/ombox.css"></templatestyles>
| Warning | This Lua module is used on many pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them. |
This module supports Template:If empty.
local p = {}
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false})
local lastk = 0
for k,v in ipairs(args) do
if v ~= '' then
return v
end
lastk = k
end
end
return p