Here you can find the source of substringAfterLast(String string, String delimiter)
public static String substringAfterLast(String string, String delimiter)
//package com.java2s; //License from project: Apache License public class Main { /**//w ww .j a v a 2 s .co m * Returns the substring after the last delimiter of the specified * occurrence. The delimiter is not part of the result. */ 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); } }