L
L
LazariusPaskalius2019-10-23 09:35:10
Java
LazariusPaskalius, 2019-10-23 09:35:10

How to remove all values ​​except numbers from a string variable?

When you start the program, a window opens in which you can enter text, you need to somehow remove all the characters ( that the user entered ) except for numbers from this field (or a variable into which data is written from the field), how can this be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-10-23
@LazariusPaskalius

You can define a PlainDocument or DocumentListener that accepts only numbers and hang it on the input field.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question