public static Map<String, Object> transStringToMap(String mapString, String separator, String pairSeparator) { Map<String, Object> map = new HashMap<String, Object>(); String[] fSplit = mapString.split(separator); System.out.println("fSplit.length" + fSplit.length); for (int i = 0; i < fSplit.length; i++) { if (fSplit[i] == null || fSplit[i].length() == 0) { continue; } String[] sSplit = fSplit[i].split(pairSeparator); String value = fSplit[i].substring(fSplit[i].indexOf('=') + 1, fSplit[i].length()); map.put(sSplit[0], value); } return map; }