To check what you're asking for, you would have to iterate through the values that are contained in the array, and check whether they contain the value of the string that you want to check.
for (String fromArray : array) {
if (fromArray.contains(mystring)) {
// put your code here
}
}
This method is case sensitive. To overcome this, you can either change the strings to lowercase (with the toLowerCase()
method), or use a library that has been designed to do so. One such library is the Apache Commons library.
If you want to check whether the array element, instead of containing, instead matches the string you want to check it against, you would use the matches()
method.
Documentation links:
http://docs.oracle.com/javase/7/docs/api/java/lang/String.html