Module:Utility: Difference between revisions

From IdleOn MMO Wiki
mNo edit summary
mNo edit summary
Line 1: Line 1:
local util = {}
local util = {}
-- Strings
util.tooltipstruct = [[<span class="simple-tooltip simple-tooltip-inline tooltipstered" data-simple-tooltip="%s">%s</span>]]


util.tooltipstruct = [[<span class="simple-tooltip simple-tooltip-inline tooltipstered" data-simple-tooltip="%s">%s</span>]]
 
-- Functions
function util.explode(list, delimiter)
    if delimiter == nil then
delimiter = "%s"
end
local t = {}
for str in string.gmatch(list, "([^" .. delimiter .. "]+)") do
table.insert(t, str)
end
return t
end


return util
return util

Revision as of 02:04, 15 March 2024

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

local util = {}
-- Strings
util.tooltipstruct = [[<span class="simple-tooltip simple-tooltip-inline tooltipstered" data-simple-tooltip="%s">%s</span>]]


-- Functions
function util.explode(list, delimiter)
    if delimiter == nil then
		delimiter = "%s"
	end
	local t = {}
	for str in string.gmatch(list, "([^" .. delimiter .. "]+)") do
		table.insert(t, str)
	end
	return t
end

return util