code: public static int lookup(String source, String[] target) {
          for (int i = 0; i < target.length; ++i) {
              if (source.equals(target[i])) return i;
          }
          return -1;
      }
docs: Look up a given string in a string array.  Returns the index at
  which the first occurrence of the string was found in the
  array, or -1 if it was not found.
  @param source the string to search for
  @param target the array of zero or more strings in which to
  look for source
  @return the index of target at which source first occurs, or -1
  if not found