java 8 check if string is in list of static strings code example
Example: check if a list contains a string java
String search = "A";
for(String str: myList) {
if(str.trim().contains(search))
return true;
}
return false;
String search = "A";
for(String str: myList) {
if(str.trim().contains(search))
return true;
}
return false;