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
You can specify the start index with indexOf. So, in your loop you store the last position of 'x', then search again using that index + 1.