Answer the question
In order to leave comments, you need to log in
How to delete all lines with the specified letter [SOLVED]?
Hello, tell me how to get out, there is a code:
ArrayList <String> list = new ArrayList();
list.add("коля");
list.add("воля");
list.add("боля");
for(String s : list){
if(list.contains("к")){
list.remove(s);
Answer the question
In order to leave comments, you need to log in
1. it's not good to delete the elements of the list you are running through
2. you need to look for the character in the string, not in the list
for(String s : list)
if(s.contains("к"))
list.remove(s);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question