Java Utililty Methods Array Has

List of utility methods to do Array Has

Description

The list of methods to do Array Has are organized into topic(s).

Method

booleaninArray(int[] arr, int search)
in Array
if (arr != null) {
    for (int i = 0; i < arr.length; i++) {
        if (arr[i] == search) {
            return true;
return false;
...
booleaninArray(int[] array, int needle)
in Array
boolean found = false;
for (int i = 0; i < array.length; i++) {
    if (array[i] == needle) {
        found = true;
        break;
return found;
...
booleaninArray(Object[] ps, Object p)
in Array
if (ps == null)
    return false;
for (int i = 0; i < ps.length; i++) {
    if (ps[i] == p)
        return true;
    if (ps[i].equals(p))
        return true;
return false;
booleaninArray(String arg, String[] array)
check if a string is in an array of strings, checking all elements
int i, len;
boolean res = false;
len = array.length;
if (len > 0)
    for (i = 0; i < len; i++) {
        if (arg.equals(array[i]))
            res = true;
return res;
booleaninArray(String needle, String... haystack)
Test, if a string occur in an array
for (String string : haystack) {
    if (string.equals(needle))
        return true;
return false;
booleaninArray(String str, String[] stringArray)
in Array
return inArray(str, stringArray, false);
booleaninArray(String string, String[] strings)
in Array
if (string == null) {
    return false;
for (String s : strings) {
    if (s != null && s.equalsIgnoreCase(string)) {
        return true;
return false;
intinArray(String value, String[] s)
in Array
if (s != null && value != null) {
    for (int i = 0; i < s.length; i++) {
        if (value.equals(s[i])) {
            return i;
return -1;
...
booleaninArray(String value, String[] values)
in Array
if (value != null && values != null) {
    for (String v : values) {
        if (value.equals(v)) {
            return true;
return false;
...
booleaninArray(String[] attributes, String attribute)
in Array
if (indexOf(attributes, attribute) >= 0) {
    return true;
return false;