How do you remove the final character in a textfield?

With AS3, I would have used this myTextField.text.slice(0, -1); in order to remove the last character in the textfield. How would I do this using HaXe/OpenFL? (Basically a hardcoded backspace feature.)

This is one way.

myTextField.text = myTextField.text.substring(0, myTextField.text.length - 1);

http://api.openfl.org/String.html

1 Like