I’m looking for a way to find where a letter is inside a word. A combination of string.Match & string.len.
There seems to be no function or parameter to do this. Can’t think of a solution either.
For example,
local word = "Octopus"
function letterfind(word)
local letter = p
local place = 5
return (letter,place)
end
letterfind(Octopus)
string.sub with only two arguments (the string and the starting position) assumes that the third argument is -1 which is equivalent to the string’s length.
The second example won’t return nil, it’ll return an empty string instead.