SirniNamaz Posted September 23, 2012 Share Posted September 23, 2012 how do u remove the last letter from variable? Link to comment
SirniNamaz Posted September 23, 2012 Author Share Posted September 23, 2012 just like a backspace. remove the last letter when i press the button. Link to comment
Jaysds1 Posted September 23, 2012 Share Posted September 23, 2012 Do you mean like this: local word = "Tooky" --remove the last letter to make it say 'Took' Link to comment
Guest Guest4401 Posted September 23, 2012 Share Posted September 23, 2012 local text = "abcde" print ( text:sub(1,#text-1) ) -- "abcd" Link to comment
50p Posted September 23, 2012 Share Posted September 23, 2012 local text = "abcde" print ( text:sub(1,#text-1) ) -- "abcd" Or local text = "abcde" print ( text:sub(1,-2) ) -- "abcd" 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