private static String stripLeadingNonNumeric ( String str ) { for ( int x = 0 ; x < str . length ( ) ; x ++ ) { if ( Character . isDigit ( str . codePointAt ( x ) ) ) { return str . substring ( x ) ; } } return null ; }
Strips leading non - numeric values from the start of the string . If no numbers are present this will return null .