Here you can find the source of replaceString(String s, Map
public static final String replaceString(String s, Map<String, String> replacement)
//package com.java2s; import java.util.Locale; import java.util.Map; public class Main { public static final String replaceString(String s, Map<String, String> replacement) { if (s != null && !s.equals("") && replacement != null) { for (String key : replacement.keySet()) { String actualKey = "\\{" + key.toUpperCase(Locale.US) + "\\}"; s = s.replaceAll(actualKey, replacement.get(key)); }/*from www .j av a 2 s . c om*/ } return s; } }