Module:Cmap

From Heroes 3 wiki
Revision as of 19:04, 6 January 2024 by Imahero (talk | contribs)
Jump to navigation Jump to search

Returns arg1 with all instances of arg2 replaced with arg3.

Example

{{#invoke:cmap|cmap|needle in haystack|needle|hay}}

local p = {} --p stands for package

function p.cmap(frame)
	if frame.args[1] then
		return mw.ustring.gsub(frame.args[1], '400px', '100px')[0]
	end
	return ''
end

return p