This question has already been answered:

My code

String Uy = "Terop"; for (String s : Uy.split("")) { if (s == "e") { continue ; } System.out.println(s); } 

I want him to filter the letters e. (that is, it did not execute the output and returned to the beginning of the loop. I use the continue operator (as I do in python), it still does not return to the beginning of the loop and outputs.

Reported as a duplicate by YurySPb. java 11 Jun '18 at 10:13

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • one
    Strings in Java must be compared through equals . Operator == compares the links, but they are different here, we sit down and do not work. - Yuriy SPb

0