Module:Contains

From Heroes 3 wiki
Revision as of 20:50, 6 June 2021 by Imahero (talk | contribs) (Created page with "local p = {} --p stands for package function p.value(frame) if string.find(frame.args.haystack, frame.args.needle) then return 1 end return 0 end return p")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Usage[edit]

{{#invoke:contains|value|haystack={{{1|needle in a haystack}}}|needle={{{2|needle}}}}}


local p = {} --p stands for package

function p.value(frame)
	if string.find(frame.args.haystack, frame.args.needle) then
		return 1
	end
    return 0
end

return p