Android examples for java.util:Map
split string Into Map
import java.net.URL; import java.net.URLDecoder; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class Main{ public static Map<String, String> splitIntoMap(String text, String delimiter, String separator) { HashMap<String, String> ret = new HashMap<String, String>(); String decodedString = ""; try {/*from w w w. ja va2 s.c o m*/ decodedString = URLDecoder.decode(text, "UTF-8"); } catch (Exception e) { } String[] split = decodedString.split(delimiter); for (String string : split) { if (string.contains(separator)) { String[] element = string.split(separator); if (element.length == 2) ret.put(element[0], element[1]); } } return ret; } }