Strings { public static String substringAfterLast(String str, String separator) { if (isNullOrEmpty(str)) { return str; } if (isNullOrEmpty(separator)) { return EMPTY; } int pos = str.lastIndexOf(separator); if (pos == INDEX_NOT_FOUND || pos == str.length() - separator.length()) { return EMPTY; } return str.substring(pos + separator.length()); } private  Strings(); static String abbreviate(String str, int offset, int maxWidth); static String abbreviateMiddle(String string, int maxLength); static String abbreviateFqClassName(String fqcn); static String capitalize(String str); static String substringAfterLast(String str, String separator); static String strip(String str, String stripChars); static String stripStart(String str, String stripChars); static String stripEnd(String str, String stripChars); static String getParent(String path); static String getDomain(String url); static String sanitize(String str);  }
@Test public void substringAfterLast() throws Exception { assertNull(Strings.substringAfterLast(null, "/")); assertEquals("", Strings.substringAfterLast("", "/")); assertEquals("", Strings.substringAfterLast("a", "/")); assertEquals("c", Strings.substringAfterLast("a/b/c", "/")); }