Here you can find the source of between(String text, String begin, String end)
public static String between(String text, String begin, String end)
//package com.java2s; //License from project: Apache License public class Main { public static String between(String text, String begin, String end) { if (text == null) { return null; }/*from w w w . j av a 2s . com*/ int idx = text.indexOf(begin); if (idx < 0) { idx = 0; } else { idx = idx + begin.length(); } int eidx = text.indexOf(end, idx); if (eidx < 0) { eidx = 0; } return text.substring(idx, eidx); } }