Java URL Parameter Builder getParameter(String source, int index)

Here you can find the source of getParameter(String source, int index)

Description

get Parameter

License

Open Source License

Declaration

public static String getParameter(String source, int index) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

public class Main {
    public static String getParameter(String source, int index) {
        String[] result = source.split("&");

        try {//w ww.  j a  v a 2 s.c  o m
            return URLDecoder.decode(result[index].substring(result[index].indexOf("=") + 1), "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }

        return null;
    }
}

Related

  1. convertToDataString(Map data)
  2. convertToParameterString(Map parameterMap)
  3. extractParameters(String parameterString)
  4. format(final Map> parameters, final String encoding)
  5. format(Map parameters, final String encoding)
  6. getParameterMap(byte[] bytea)
  7. getParams(String str)
  8. getUrlParameters(final String url)
  9. getUrlParameters(String url)