I have a list of words that I've turned into a string array. I ask the user to enter a character, and my code must find whether that character is in one of the words in the list of words and add that word to a new list and removed from the original list. How do I do that? Here's
String[] temps2 = newList.toArray(new String[0]); //turns list to string array.
System.out.println("\n pick a letter.");
letter_1 = input.next()charAt(0);
for (String b : temps2){
for(char ch : b.toCharArray()){
if letter_1==ch){
temps2.remove(b);//don't think you can do that.