Here you can find the source of substringAfter(String sourceStr, String expr)
public static String substringAfter(String sourceStr, String expr)
//package com.java2s; //License from project: Apache License public class Main { public static String substringAfter(String sourceStr, String expr) { if (isEmpty(sourceStr) || expr == null) { return sourceStr; }//from w w w. j a v a 2 s . c o m if (expr.length() == 0) { return sourceStr; } int pos = sourceStr.indexOf(expr); if (pos == -1) { return sourceStr; } return sourceStr.substring(pos + expr.length()); } public static boolean isEmpty(String chkStr) { if (chkStr == null) { return true; } else { return "".equals(chkStr.trim()) ? true : false; } } public static boolean isEmpty(CharSequence chkSeq) { if (chkSeq == null) { return true; } else { return "".equals(chkSeq.toString().trim()) ? true : false; } } public static String toString(Object obj) { return obj == null ? "" : obj.toString(); } public static String toString(Object obj, String nullStr) { return obj == null ? nullStr : obj.toString(); } }