Here you can find the source of between(String str, String left, String right)
public static String between(String str, String left, String right)
//package com.java2s; //License from project: Apache License public class Main { public static String between(String str, String left, String right) { int leftIndex = str.indexOf(left); int rightIndex = str.lastIndexOf(right); // if (leftIndex == -1) { // leftIndex = 0; // }//ww w. j a v a 2 s . c o m if (rightIndex == -1) { rightIndex = str.length(); } return str.substring(leftIndex + left.length(), rightIndex); } }