steadyfi Posted March 21, 2015 Share 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. Link to comment
Et-win Posted March 21, 2015 Share Posted March 21, 2015 string.find(string, "#%x%x%x%x%x%x", 1, true) Correct me if I'm wrong. Link to comment
JR10 Posted March 21, 2015 Share 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. Link to comment
steadyfi Posted March 21, 2015 Author Share 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 ! Link to comment
Et-win Posted March 21, 2015 Share 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* 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