I am trying to find if a string has any of the following:
." (period followed by quotation mark)
," (comma followed by quotation mark)
!" (exclamation point followed by quotation mark)
?" (question mark followed by quotation mark)
+ (plus sign)
I am using this:
if myString:find(".\"") or myString:find(",\"") or myString:find("?\"") or myString:find("!\"") or myString:find("+") then
print("Found one")
else
print ("Didn't find one")
end
The problem is that the if is coming back as true if any quotation mark is found in the string, not just ones preceded by a punctuation mark.
Is my code for finding that match wrong? [import]uid: 17827 topic_id: 34576 reply_id: 334576[/import]