I have a string that is the complete content of an html page and I am trying to find the index of 2nd occurence of . Does anyone have any suggesti
Another good option for finding the Nth occurrence of a String is to use StringUtils.ordinalIndexOf() from Apache Commons:
StringUtils.ordinalIndexOf("aabaabaa", "b", 2) == 5