Here you can find the source of substringBetween(String str, String open, String close)
public static String substringBetween(String str, String open, String close)
//package com.java2s; //License from project: LGPL public class Main { public static String substringBetween(String str, String open, String close) { if (str == null || open == null || close == null) { return null; }//from w w w . j a v a 2s . c om int start = str.indexOf(open); if (start != -1) { int end = str.indexOf(close, start + open.length()); if (end != -1) { return str.substring(start + open.length(), end); } } return null; } }