Here you can find the source of substringBetweenStrings(String within, String pre, String post)
public static String substringBetweenStrings(String within, String pre, String post)
//package com.java2s; //License from project: Open Source License public class Main { public static String substringBetweenStrings(String within, String pre, String post) { int from = within.indexOf(pre); if (from < 0) return null; from += pre.length();//w w w .j a va2 s . c o m int to = within.indexOf(post, from); if (to < 0) return null; return within.substring(from, to); } }