check if string only contains numbers code example
Example 1: check if string contains numbers
str.matches(".*\\d.*");
Example 2: python how to check if string contains only numbers
print("012345".isdecimal())
OUTPUT
True
print("a12345".isdecimal())
OUTPUT
False