for(int i=0;i<entries.size();i++){
//if it has java or the correct answer it will say its valid
// if not it will remove the element from the array
if(entries.get(i).contains("java")){
System.out.println("Is valid");
}else if(entries.get(i).contains(correctAnswer)){
System.out.println("Is valid");
}else{
entries.remove(entries.get(i));
}
}
//create a new list that will store the winners
ArrayList<String> winners = new ArrayList<String>();
//generate random number from 0 to 100
int rand = (int)(Math.random() * 100);
//while the array size is less then the prizeCount add another random element from array "entries"
//until it is the same size as the prizeCount
while(winners.size()<prizeCount){
winners.add(entries.get(rand));
}
return winners;
//remove java and correct answer from the elements in the list
for(int i=0; i<winners.size();i++){
this bit here is where im lost im trying to remove a substring from the array of elements and return the array in assecding order
so ill have java <answer> john 0872972956
turned into john 0872972956
and have the list of names and numbers in alphabetical order.
your help would be much appreciated and im sry if its not clear what i dont know