Here you can find the source of getValueFromQueryString(String url, String key)
public static String getValueFromQueryString(String url, String key)
//package com.java2s; public class Main { public static String getValueFromQueryString(String url, String key) { int keyStPos = url.indexOf(key + "=") + key.length() + 1; if (keyStPos == -1) { return ""; }// ww w .j av a 2s. c om int keyEnPos = url.indexOf("&", keyStPos); if (keyEnPos == -1) { keyEnPos = url.length(); } return url.substring(keyStPos, keyEnPos); } public static int indexOf(String str, String searchStr) { if (str == null || searchStr == null) { return -1; } return str.indexOf(searchStr); } }