Module:Explode String

From Valheim Wiki
Revision as of 20:55, 18 February 2021 by Mave (talk | contribs) (Created page with "local p = {} p.loop = function(frame) local stage = frame.args.stage local rows = {} -- the actual looping part for value in mw.text.gsplit(stage, ',') do table.insert(r...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

local p = {}
p.loop = function(frame)
	local stage = frame.args.stage
	local rows = {}
	-- the actual looping part
	for value in mw.text.gsplit(stage, ',') do
		table.insert(rows, '|' .. value)
	end
	
	return ' {|\n' .. table.concat(rows, '\n|-\n') .. '\n|}'
end

-----------------------------------------------------------------
-- main return object
return {

go = function(frame, args)
	string = getArg('string')
	linksuffix = getArg('linksuffix') or ''

	-- output
	return string..linksuffix..'test'

end,

}