H5N1 Posted July 7, 2011 Share Posted July 7, 2011 Hello. I made mysql register system but I want to remove HEX code (RRGGBB) from nicknames. How can i do it? Some time ago I saw simple function which was removing HEX code, but I cant find it now. Link to comment
JR10 Posted July 7, 2011 Share Posted July 7, 2011 function removeHEXFromString(str) str:gsub("#%x%x%x%x%x%x", "") end Link to comment
Deltanic Posted July 7, 2011 Share Posted July 7, 2011 Add 'return' in front of str:gsub, otherwise there won't be a new string returned Link to comment
JR10 Posted July 7, 2011 Share Posted July 7, 2011 forgot that. function removeHEXFromString(str) return str:gsub("#%x%x%x%x%x%x", "") end 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