Merge pull request #548 from Shawak/master

string:contains()
This commit is contained in:
Ben Dol 2014-08-10 16:55:51 +12:00
commit fa317c534d
1 changed files with 8 additions and 0 deletions

View File

@ -49,3 +49,11 @@ function string:explode(sep, limit)
table.insert(t, tmp)
return t
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