String (@NotNull String text, int offset, @NotNull Collection<Character> separators) { int index = -1; for (char c : separators) { index = Math.max(text.lastIndexOf(c, offset - 1), index); } return text.substring(index + 1, offset); }