Java Regex String Replace replace(String string, Pattern pattern, String replacement)

Here you can find the source of replace(String string, Pattern pattern, String replacement)

Description

replace

License

Open Source License

Declaration

private static String replace(String string, Pattern pattern, String replacement) 

Method Source Code

//package com.java2s;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    private static String replace(String string, Pattern pattern, String replacement) {
        Matcher m = pattern.matcher(string);
        return m.replaceAll(replacement);
    }/* w w w.j a va 2s. co m*/
}

Related

  1. replace(String source, String search, String replace)
  2. replace(String source, String search, String replacement)
  3. replace(String source, String[] patterns, String[] replacements)
  4. replace(String str, String key, String value)
  5. replace(String str, String replacement, Function func)
  6. replace(String string, Pattern[] patterns, String[] replacements)
  7. replace(String string, Properties table)
  8. replace(String string, String pattern, String replacement, boolean literal)
  9. replace(String text, Map vars, String prefix)