Java String to Map toMap(String str)

Here you can find the source of toMap(String str)

Description

to Map

License

Apache License

Declaration

private static final Map<String, String> toMap(String str) 

Method Source Code

//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;
    }
}

Related

  1. toMap(String jsonStr)
  2. toMap(String parameters)
  3. toMap(String s)
  4. toMap(String s)
  5. toMap(String source)