Snippets tagged “matches”
1 snippet uses this tag.
- How to check if a string contains only digits in JavaJava
To check if a string contains only digits in Java, you can use the matches() method of the String class in combination with the regular expression "\\d+".