Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java can i use contain for array

import java.util.Arrays;

// For String
String[] array = {"Boto", "Nesto", "Lepta"};
String toSearch = "Nesto";

// Inline
if (Arrays.toString(array).contains(toSearch)) {
	// Do something if it's found
}
Source by stackabuse.com #
 
PREVIOUS NEXT
Tagged: #java #array
ADD COMMENT
Topic
Name
9+9 =