mirror of
https://github.com/ShadMOrdre/lib_materials.git
synced 2024-11-20 01:10:27 +01:00
20 lines
271 B
Lua
20 lines
271 B
Lua
|
|
||
|
function table.contains_substring(t, s)
|
||
|
if type(s) ~= "string" then
|
||
|
return nil
|
||
|
end
|
||
|
|
||
|
for key, value in pairs(t) do
|
||
|
if type(value) == 'string' and s:find(value) then
|
||
|
if key then
|
||
|
return key
|
||
|
else
|
||
|
return true
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
return false
|
||
|
end
|
||
|
|
||
|
|