Jump to content

Module:Substring?

From Wikibooks, open books for an open world
local export = {}

function export.check( frame )
	local x = frame.args[1]
	if (x == nil) then return "" end
	local y = frame.args[2]
	if (y == nil) then return "" end
	local z = mw.ustring.find( x, y, 1, true )
	if (z ~= nil) then return z end
	return ""
end

return export