Here you can find the source of substitute(String page, String payRef, String name, String emailAddress, String when, String license, Map
public static String substitute(String page, String payRef, String name, String emailAddress, String when, String license, Map<String, String> map)
//package com.java2s; //License from project: Apache License import java.util.Map; public class Main { public static String substitute(String page, String payRef, String name, String emailAddress, String when, String license, Map<String, String> map) { String x = page;/*from w w w. j a va2 s.c om*/ for (Map.Entry<String, String> en : map.entrySet()) { x = replace(x, en.getKey(), en.getValue()); } x = x.replace("$PAYREF$", payRef); x = x.replace("$NAME$", name); x = x.replace("$EMAIL$", emailAddress); x = x.replace("$WHEN$", when); x = x.replace("$LICENCE$", license); return x; } private static String replace(String x, String key, String value) { String replaceKey = "$" + key.toUpperCase() + "$"; return x.replace(replaceKey, value); } }