private static int findIndex ( String [ ] array , String target ) { for ( int i = 0 ; i < array . length ; i ++ ) { if ( target . equals ( array [ i ] ) ) { return i ; } } return - 1 ; }
linear search of the string array . the arrays are unfortunately ordered by the two - letter target code not the three - letter search code which seems backwards .