Fix string helper if string is empty

This commit is contained in:
Josué Tille 2019-01-23 10:22:02 +01:00
parent e7a131063e
commit 441f323094
No known key found for this signature in database
GPG key ID: D5E068C6DFA8681D

View file

@ -38,6 +38,9 @@ end
-- Test whether a string starts with another -- Test whether a string starts with another
function string.starts(String, Start) function string.starts(String, Start)
if not String then
return false
end
return string.sub(String, 1, string.len(Start)) == Start return string.sub(String, 1, string.len(Start)) == Start
end end