I have a String[] with values like so:
String[]
public static final String[] VALUES = new String[] {\"AB\",\"BC\",\"CD\",\"AE\"};
Given
You can use the Arrays class to perform a binary search for the value. If your array is not sorted, you will have to use the sort functions in the same class to sort the array, then search through it.