Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static String getValueFormURL(String url, String key) {
        key += "=";
        if (url.contains(key)) {
            int aid = url.indexOf(key) + key.length();
            if (url.indexOf("&", aid) != -1) {
                return url.substring(aid, url.indexOf("&", aid));
            } else {
                return url.substring(aid, url.length());
            }
        } else {
            return null;
        }
    }
}