Here you can find the source of replace(String s, List
public static String replace(String s, List<String> replacementVars)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String replace(String s, List<String> replacementVars) { for (String r : replacementVars) { s = s.replaceFirst("\\{\\}", r); }//ww w. j av a 2 s . c o m return s; } }