fix string.startswith

This commit is contained in:
ruki
2020-11-20 22:36:08 +08:00
parent ff1610e0ea
commit 745345183b

View File

@@ -23,7 +23,7 @@ local string = string or {}
-- match the start string -- match the start string
function string:startswith(str) function string:startswith(str)
return self:find('^' .. str) ~= nil return self:find(str, 1, true) == 1
end end
-- find the last substring with the given pattern -- find the last substring with the given pattern