Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String ExtractBtw(String text, String sFrom, String sTo) {
        String result = "";
        int ifrom = text.indexOf(sFrom);
        if (ifrom != -1) {
            int ito = text.indexOf(sTo, ifrom + sFrom.length());
            if (ito != -1) {
                result = text.substring(ifrom + sFrom.length(), ito);
            }
        }
        if (result == null)
            result = "";
        return result;
    }
}