string:contains()

This commit is contained in:
Shawak 2014-07-31 20:25:31 +02:00
parent fe585d27d8
commit 939e16c59a
1 changed files with 8 additions and 0 deletions

View File

@ -49,3 +49,11 @@ function string:explode(sep, limit)
table.insert(t, tmp) table.insert(t, tmp)
return t return t
end end
function string:contains(str, checkCase, start, plain)
if(not checkCase) then
self = self:lower()
str = str:lower()
end
return string.find(self, str, start and start or 1, plain == nil and true or false)
end