Here you can find the source of substringAfter(String text, int index)
private static String substringAfter(String text, int index)
//package com.java2s; public class Main { private static final String EMPTY = ""; private static final int INDEX_NOT_FOUND = -1; public static String substringAfter(String text, String separator) { int index = indexOf(text, separator); return substringAfter(text, index); }//from w w w . j a v a 2s . c om private static String substringAfter(String text, int index) { if (index == INDEX_NOT_FOUND) { return EMPTY; } return text.substring(index + 1, text.length()); } private static int indexOf(String text, String separator) { if (isBlank(text)) { return INDEX_NOT_FOUND; } return text.indexOf(separator); } public static boolean isBlank(String text) { return text == null || text.trim().isEmpty(); } }