code: public String substringBetween(String string, String begin, String end, boolean includeBoundaries) {
  		if (string == null || begin == null || end == null) {
  			return null;
  		}
  		int startPos = string.indexOf(begin);
  		if (startPos != -1) {
  			if (includeBoundaries)
  				startPos = startPos - begin.length();
  			int endPos = string.lastIndexOf(end);
  			if (endPos != -1) {
  				if (includeBoundaries)
  					endPos = endPos + end.length();
  				return string.substring(startPos + begin.length(), endPos);
  			}
  		}
  		return null;
  	}
docs: Gets a substring between the begin and end boundaries
  
  @param string
  original string
  @param begin
  start boundary
  @param end
  end boundary
  @param includeBoundaries
  include the boundaries in substring
  @return substring between boundaries