Answers for "java string array check if value exists"

1

java if one sting on array match

String[] fieldsToInclude = { "id", "name", "location" };

if ( ArrayUtils.contains( fieldsToInclude, "id" ) ) {
    // Do some stuff.
}
Posted by: Guest on February-13-2021
0

check if array contains a number in java

public static boolean contains(final int[] arr, final int key) {
    return Arrays.stream(arr).anyMatch(i -> i == key);
}
Posted by: Guest on May-24-2021

Code answers related to "java string array check if value exists"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language