-- find returns the start and end index of the match local s = "hello world" local i, j = string.find(s, "world") print(i, j) -- it returns nil when there is no match print(string.find(s, "xyz"))
string.find returns match indices