Here you can find the source of replaceTemplates(String template, Map
public static String replaceTemplates(String template, Map<String, String> entries)
//package com.java2s; import java.util.Map; public class Main { public static String replaceTemplates(String template, Map<String, String> entries) { for (Map.Entry<String, String> e : entries.entrySet()) { template = template.replaceAll(e.getKey(), e.getValue()); }/*from www. ja v a 2s .co m*/ return template; } }