public static boolean hasDigit ( String str ) { final Pattern pattern = Pattern . compile ( "[0-9]" ) ; final Matcher matcher = pattern . matcher ( str ) ; while ( matcher . find ( ) ) { return true ; } return false ; }
Returns true if this string contains digits false otherwise .