I am trying to find a subString inside a string, in an arraylist, but I can't get it working. It has to loop through the arraylist until it finds the sub string, and then stop.
Here is what I have so far
private static void teamSearch(String teamName) {
String subString = teamName;
String string = "";
boolean contains = false;
while (contains = false){
for (int i = 0; i < clubList.size(); i++){
string = clubList.get(i).aliases;
contains = string.contains(subString);
}
System.out.println(contains);
}
}
Any help in getting this working would be much appreciated :) Thank you!
constainsis true.