public static boolean contains(String[] array, String item) {
        if (array == null || array.length == 0 || item == null) {
            return false;
        }
        for (String anArray : array) {
            if (item.equals(anArray)) {
                return true;
            }
        }
        return false;
    }
Returns true if the given string is in the given array.

@param array an array of Strings to check
@param item the item to look for
@return true if the array contains the item
xmppserver/src/main/java/org/jivesoftware/util/StringUtils.java