// e.g. "* is *" to "<1> to <2>" sS starsToAngleBracketedNumbers(S s) { LS tok = javaTokWithAngleBrackets(s); int count = 0; for (int idx : indicesOf(tok, "*")) tok.set(idx, angleBracketed(str(++count))); ret join(tok); }