Java List Replace replace(List list, char target, char replacement)

Here you can find the source of replace(List list, char target, char replacement)

Description

replace

License

Open Source License

Declaration

public static List<String> replace(List<String> list, char target,
            char replacement) 

Method Source Code

//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;
    }
}

Related

  1. replace(final List list, final T newElement, final int index)
  2. replace(final String source, final List search, final List repl)
  3. replace(List list, Object o, Object n)
  4. replace(List list, T element, List replacements)
  5. replace(List list, T from, T to)
  6. replace(String s, List replacementVars)
  7. replace(String sourceStr, List indexList, String replaceStr)
  8. replaceAll(final List list, final T element0, final T element1)