Here you can find the source of substringAfterLast(final String str, final String separator)
public static String substringAfterLast(final String str, final String separator)
//package com.java2s; //License from project: Apache License public class Main { public static String substringAfterLast(final String str, final String separator) { if (str == null) { return null; }// w ww . j ava 2 s . co m final int pos = str.lastIndexOf(separator); if (pos == -1 || pos == (str.length() - separator.length())) { return ""; } return str.substring(pos + separator.length()); } }