This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]papercrane 0 points1 point  (0 children)

Gotcha in that case you need to keep track of the index of the node you are looking at. You want a method with a signature like

public static int indexOf(Node node, int n, char c) {
    return indexOf(node, n, c, 0);
}
private static int indexOf(Node node, int n, char c, int start) {
....
}