5
I have a list with two or more strings:
[Panel, Control]
Now comes the problem:
for (int i = 0; i < lista.size(); i++){
String linha = "";
while ((linha = leitura.readLine()) != null){
if (linha.contaens(lista.get(i))){
System.out.println(lista);
1 - Executes for with i equal to 0.
2 - Run while and read line by line looking for the first string in the list until you reach null
.
3 - The for is called again with i equal to 1.
4 - while does not execute, because the leitura.readLine()
flipped null
.
5 - How do pro while run until lista.size()
times? Until the list runs out.
In my code it only fetches the first String from the list, but the next one does not execute because the line turned null in the first search.
don’t understand your problem. Your problem is that you have a line like this? "A B" and you want to catch A first, then B?
– Rubico
No. When the while runs for the first time, it is true, now when it runs for the second time, it is false... like letting it true?
– Marcelo