I had a question about the indexOf method. I want to find multiple cases of \"X\" in a string.
Suppose my string is \"x is x is x is x\", I want to find x in all of
There is a second variant of the indexOf method, which takes a start-index as a parameter.
indexOf
i = str.indexOf('x'); while(i >= 0) { System.out.println(i); i = str.indexOf('x', i+1); }