GuyFromPast Posted March 25, 2011 Share Posted March 25, 2011 Is it possible to make it ignore upper letters ? like if the word is HELLO then its same as hello and will find same result... thanks for any kind of help Link to comment
qaisjp Posted March 25, 2011 Share Posted March 25, 2011 Here is my function called decodeAndFindString. function decodeAndFindString(theString, takeOut) if tostring(theString) and tostring(toFind) then return string.find(string.lower(tostring(theString):gsub('#%x%x%x%x%x%x', '')), tostring(toFind)) end end decodeAndFindString(string, find) String is what we are trying to find something in and Find is what we are trying to find. For example if decodeAndFindString("UpperLowerHAPPYpLaYeR", "player") It will return true 'cos it found player. string.lower(string) converts to lowercase string.upper(string) converts to uppercase Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now