Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { private static String getHash(String s) { String next = s.substring(s.lastIndexOf("/"), s.length()); if (next.length() < 5) { return getHash(s.replace(next, "")); } else { return next; } } }