Here you can find the source of MapToString(Map
public static String MapToString(Map<String, String> map)
//package com.java2s; //License from project: Open Source License import java.util.Map; import java.util.Iterator; public class Main { public static String MapToString(Map<String, String> map) { String result = ""; Iterator<String> keySetIterator = map.keySet().iterator(); while (keySetIterator.hasNext()) { String key = keySetIterator.next(); result += "|" + key + ":" + map.get(key); }/*from w w w .j a va2 s . c om*/ return result; } }