public static final int findInt ( CharSequence cs , int radix , int beginIndex , int endIndex ) { IntPredicate predicate = null ; switch ( radix ) { case 8 : predicate = Primitives :: isOctalDigit ; break ; case 10 : predicate = Primitives :: isDecimalDigit ; break ; case 16 : predicate = Primitives :: isHexDigit ; break ; default : throw new UnsupportedOperationException ( "radix " + radix + " not supported" ) ; } int begin = CharSequences . indexOf ( cs , predicate , beginIndex ) ; int end = CharSequences . indexOf ( cs , predicate . negate ( ) , begin ) ; return parseInt ( cs , radix , begin , endIndex ( end , endIndex ) ) ; }
Parses next int