Android examples for java.lang:String Substring
Get sub String Between start and end
public class Main { public static String subStringBetween(String source, String start, String end) { if (source == null || start == null || end == null) { return null; }/*from w w w . ja v a 2s . c om*/ int indexOf = source.indexOf(start); if (indexOf == -1) return null; int indexOf2 = source.indexOf(end, start.length() + indexOf); return indexOf2 != -1 ? source.substring(start.length() + indexOf, indexOf2) : null; } }