Jump to content

[Help] Checking string format


steadyfi

Recommended Posts

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. :D

Link to comment
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...