For that, you would use the
String API.
e.g.
local stringA = "the word cat is within this sentence"
local wordIsThere = string.find(stringA, "cat")
if wordIsThere then print("Found cat!")
string.find will return the position of the word 'cat' within stringA, so wordIsThere would be set to 10 (since cat starts at the 10th position in the sentence).
The third line of the example is where you determine if you've found what you're looking for. Since wordIsThere has a value (in this example it is 10), it evaluates to true and the above example prints "Found cat!". If we had searched for 'dog', wordIsThere would not have a value assigned to it and would evaluate to false, and the example wouldn't print anything.
In this second example, we'll search for 'dog'…
local stringA = "the word cat is within this sentence"
local wordIsThere = string.find(stringA, "dog")
if wordIsThere then
print("Found dog!")
else
print("Didn't find dog...")
end
Since 'dog' isn't found, wordIsThere has no value assigned and evaluates to false. Since wordIsThere evaluates to false, the example will print "Didn't find dog…"
EDIT: :ph34r:/>'d