Here you can find the source of replace2(String str, Map
Parameter | Description |
---|---|
str | the str |
data | the data |
public static String replace2(String str, Map<String, String> data)
//package com.java2s; //License from project: Apache License import java.util.Map; public class Main { /**/*w ww . j a v a 2s . c o m*/ * Replace 2. * * @param str the str * @param data the data * @return the string */ public static String replace2(String str, Map<String, String> data) { for (String key : data.keySet()) { str = str.replaceAll(key, data.get(key)); } return str; } }