Here you can find the source of replaceNotContainedWithReplaced(String sentStr, Map
public static String replaceNotContainedWithReplaced(String sentStr, Map<String, String> mapNotContainedReplaced)
//package com.java2s; //License from project: Apache License import java.util.Map; public class Main { public static String replaceNotContainedWithReplaced(String sentStr, Map<String, String> mapNotContainedReplaced) { for (String notContained : mapNotContainedReplaced.keySet()) { sentStr = sentStr.replace(notContained, mapNotContainedReplaced.get(notContained)); }//from ww w .jav a2s. com return sentStr; } }