For example - "I like apples and pie" how can I find "apples" and nothing else of the string?
✓ ANSWER ACCEPTED
How could I find a certain word in a whole string?
2 answers
✓ Accepted answer
local str = "Hello World!"
local match = string.match(str, "World!")
-- This would return either "World!" or nil.
local string = "I like apples and pie"
if string:find("apples") then
--stuff
end
i hope this works
This discussion is preserved as it was. New answers, comments, and votes are closed.
