public static int findFirstOf ( String container , String chars , int begin ) { int minIdx = - 1 ; for ( int i = 0 ; i < chars . length ( ) && i >= 0 ; ++ i ) { int idx = container . indexOf ( chars . charAt ( i ) , begin ) ; if ( ( idx < minIdx && idx != - 1 ) || minIdx == - 1 ) { minIdx = idx ; } } return minIdx ; }
Find the first occurrence .