How can I check if a String in java has no letters, only numbers? Thank you for the answer
You can use regex: yourString.matches("\\d+")
\\d means one digit 0-9, + means one or more, combined \\d+ is equal to one or more digit :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With