3B00DG4MER Posted May 25, 2015 Share Posted May 25, 2015 Hi guys, I was trying an editfield with dx i had problem how to replace for ex : "3B00DG4MER" with "***********" or "hi" with "**" i tried using string.gsub string.gsub(self.edit.text, "(%a)", function(w) return "*" end) Link to comment
WhoAmI Posted May 25, 2015 Share Posted May 25, 2015 (edited) string.gsub ( self.edit.text, ".", "*" ) Edited May 25, 2015 by Guest Link to comment
tosfera Posted May 25, 2015 Share Posted May 25, 2015 use lua's string.rep function to repeat something. can be used like; dxDrawText ( string.rep ( "*", string.length ( self.edit.text ) ), ... This way, you don't have to save the password somewhere else for your authentication ( if it's a password ). Link to comment
3B00DG4MER Posted May 25, 2015 Author Share Posted May 25, 2015 string.len and not string.length Ty anyway 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