Here you can find the source of truncateString(String resource, String startTag, String endTag)
public static String truncateString(String resource, String startTag, String endTag)
//package com.java2s; public class Main { public static String truncateString(String resource, String startTag, String endTag) {//from w w w . j ava 2 s. c om int start = resource.indexOf(startTag); int end = resource.indexOf(endTag, start + startTag.length()); if (start != -1 && end != -1) { resource = resource.substring(start + startTag.length(), end); return resource; } return null; } }