Here you can find the source of toMap(String str)
private static final Map<String, String> toMap(String str)
//package com.java2s; //License from project: Apache License import java.util.HashMap; import java.util.Map; public class Main { private static final Map<String, String> toMap(String str) { Map<String, String> map = new HashMap<String, String>(); String[] strs = str.split("&"); for (int i = 0; i < strs.length; i++) { String[] ss = strs[i].split("="); map.put(ss[0], ss[1]);/* w ww. j ava2s. c om*/ } return map; } }