Check out example codes for "replaceall in java". It will help you in understanding the concepts better.

Code Example 1

public class ReplaceAllExample{  
public static void main(String args[]){  
String s1="Google is a very good website";  
String replaceString=s1.replaceAll("a","e");//replaces all occurrences of "a" to "e"  
System.out.println(replaceString);  
}}

Learn ReactJs, React Native from akashmittal.com