steadyfi Posted March 21, 2015 Posted March 21, 2015 Hello Is there a way to check if a string is equal to a format, like HEX for exemple. I wan't to check if the player enters a VALID HEX CODE and if yes then go forward, else return. Is there a way to check if color == format("#%x%x%x%x%x%x") and check if HEX code is valid ? Thanks.
Et-win Posted March 21, 2015 Posted March 21, 2015 string.find(string, "#%x%x%x%x%x%x", 1, true) Correct me if I'm wrong.
JR10 Posted March 21, 2015 Posted March 21, 2015 string.find(string, "#%x%x%x%x%x%x", 1) The last parameter shouldn't be true, this will treat the text as plain, which is not what he wants here.
steadyfi Posted March 21, 2015 Author Posted March 21, 2015 string.find(string, "#%x%x%x%x%x%x", 1, true) Correct me if I'm wrong. Doesn't work string.find(string, "#%x%x%x%x%x%x", 1) The last parameter shouldn't be true, this will treat the text as plain, which is not what he wants here. It works, thanks !
Et-win Posted March 21, 2015 Posted March 21, 2015 string.find(string, "#%x%x%x%x%x%x", 1) The last parameter shouldn't be true, this will treat the text as plain, which is not what he wants here. *cough* forgot *cough*
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