Here you can find the source of replace(List
public static List<String> replace(List<String> list, char target, char replacement)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static List<String> replace(List<String> list, String target, String replacement) { ArrayList<String> result = new ArrayList<String>(list); for (int i = 0; i < list.size(); i++) { result.set(i, result.get(i).replace(target, replacement)); }/*from w w w. ja va 2 s . c o m*/ return result; } public static List<String> replace(List<String> list, char target, char replacement) { ArrayList<String> result = new ArrayList<String>(list); for (int i = 0; i < list.size(); i++) { result.set(i, result.get(i).replace(target, replacement)); } return result; } }