Java tutorial
//package com.java2s; //License from project: Apache License public class Main { public static String substringAfterLast(String string, String delimiter) { final int index = string.lastIndexOf(delimiter); if (index == -1 || string.endsWith(delimiter)) { return ""; } return string.substring(index + 1); } }