Module:Substring?

From Wikibooks, open books for an open world
Jump to navigation Jump to search
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