Java String replaceAll()
This method replaces each substring of the string that matches the given regular expression with the given replace_str.
Syntax of Java replaceAll String
public String replaceAll(String regex, String replace_str)
Parameters
- regex: the regular expression to which this string is to be matched.
- replace_str: the string which would replace found expression.
Return Value
- This method returns the resulting String.
Java String replaceAll() Method
The String replaceAll method in Java searches for a specified string or a specified value, or a regex expression by virtue of which has the same suggests returns a new string with related characters. Let us learn about Java replaceAll string method in this article.