I need to change a piece of code which includes this:
string.indexOf(\"bc\")
How can this be changed by a solution that skips the occurrenc
As requested a more complete solution:
/** @return index of pattern in s or -1, if not found */ public static int indexOf(Pattern pattern, String s) { Matcher matcher = pattern.matcher(s); return matcher.find() ? matcher.start() : -1; }
call:
int index = indexOf(Pattern.compile("(?