Java Array Has inArray(String[] attributes, String attribute)

Here you can find the source of inArray(String[] attributes, String attribute)

Description

in Array

License

Apache License

Declaration

public static boolean inArray(String[] attributes, String attribute) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static boolean inArray(String[] attributes, String attribute) {
        if (indexOf(attributes, attribute) >= 0) {
            return true;
        }/*from  ww w  . j av a  2  s .  co m*/
        return false;
    }

    public static int indexOf(String[] attributes, String attribute) {
        if (attributes != null) {
            for (int i = 0; i < attributes.length; i++) {
                if (attributes[i] != null && attributes[i].equals(attribute)) {
                    return i;
                }
            }
        }
        return -1;
    }
}

Related

  1. inArray(String needle, String... haystack)
  2. inArray(String str, String[] stringArray)
  3. inArray(String string, String[] strings)
  4. inArray(String value, String[] s)
  5. inArray(String value, String[] values)
  6. inArray(String[] delegableOperations, String operationId)
  7. inArray(String[] haystack, String needle)
  8. inArray(T el, T[] array)
  9. inArray(T needle, T[] hayshack)