Here you can find the source of substringAfter(final String str, final String separator)
public static String substringAfter(final String str, final String separator)
//package com.java2s; //License from project: Apache License public class Main { public static final String EMPTY = ""; public static final int INDEX_NOT_FOUND = -1; public static String substringAfter(final String str, final String separator) { if (isEmpty(str)) { return str; }/*www . j ava 2 s. co m*/ if (separator == null) { return EMPTY; } final int pos = str.indexOf(separator); if (pos == INDEX_NOT_FOUND) { return EMPTY; } return str.substring(pos + separator.length()); } public static boolean isEmpty(final CharSequence cs) { return cs == null || cs.length() == 0; } }