get Middle String - Android java.lang

Android examples for java.lang:String Substring

Description

get Middle String

Demo Code

import android.content.Context;

public class Main{

    public static String getMiddleString(String all, String start,
            String end) {/*from   w  w  w . j av a  2  s  .c  o  m*/
        int beginIdx = all.indexOf(start) + start.length();
        int endIdx = all.indexOf(end);
        return all.substring(beginIdx, endIdx);
    }

}

Related Tutorials