how to see if a digit is in a string in java without isdigit code example Example: check if string contains numbers str.matches(".*\\d.*");