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's a another version of indexOf method, taking fromIndex as parameter. So, you can call it in a loop, each time passing prevPosition + 1 as a second parameter.
indexOf
fromIndex
prevPosition + 1
Documentation: http://download.oracle.com/javase/6/docs/api/java/lang/String.html#indexOf(int, int)