Here you can find the source of replaceString(Map
public static String replaceString(Map<String, Object> bodyToReplace, String replacingContent)
//package com.java2s; //License from project: Open Source License import java.util.Map; public class Main { public static String replaceString(Map<String, Object> bodyToReplace, String replacingContent) { for (Map.Entry<String, Object> entrySet : bodyToReplace.entrySet()) { System.out.println(entrySet.getKey() + "\n\n String to replace\n\n" + entrySet.getValue()); replacingContent = replacingContent.replace(entrySet.getKey(), String.valueOf(entrySet.getValue())); }/*from w w w .ja v a2 s .c om*/ return replacingContent; } }