added contains

This commit is contained in:
Scott E. Graves 2022-07-29 18:36:38 -05:00
parent a4f6519b84
commit 00c68a76aa

View File

@ -1,3 +1,12 @@
function string:contains(table)
for i = 1, #table do
if table[i] == self then
return true
end
end
return false
end
function string:ends_with(suffix) function string:ends_with(suffix)
return suffix == "" or self:sub(-(#suffix)) == suffix return suffix == "" or self:sub(-(#suffix)) == suffix
end end