class URIPath {

    static String removePartsBefore(String from, int index) {
        int applied = -1;
        String finding = from;
        int appliedSlash;

        // Find slash in the String by index
        while (applied < index) {
            appliedSlash = finding.indexOf('/');

            boolean hasNoSlash = appliedSlash == -1;
            if (hasNoSlash) return ""; // No more slashes

            finding = finding.substring(appliedSlash + 1);
            applied++;
        }
        return "/" + finding;
    }

    public  URIPath(String path);

}