Here you can find the source of substringBetween(String str, String pos1, String pos2)
public static final String substringBetween(String str, String pos1, String pos2)
//package com.java2s; /*// w w w .j av a 2 s .co m * Copyright 2005-2020 GreenTube Team All rights reserved. * Support: Huxg * License: CND team license */ public class Main { public static final String substringBetween(String str, String pos1, String pos2) { int p1 = str.indexOf(pos1); String sub = str.substring(p1 + pos1.length()); int p2 = sub.indexOf(pos2); sub = sub.substring(0, p2); return sub; } }