public static int getLastPosOfURL(final int offset, @NotNull String url) {
    for (int i = offset; i < url.length(); i++) {
      switch (url.charAt(i)) {
        case '?', '#' -> {
          return i;
        }
      }
    }
    return -1;
  }
public static int getLastPosOfURL(final int offset, @NotNull String url)