here,
replace () . public String replace (char oldChar, char newChar)
Parameters:
oldChar: old character
newChar: new character
public class ReplaceExample1{
public static void main(String args[]){
String s1="stackoverflow is a very good website";
String replaceString=s1.replace('a','e');
System.out.println(replaceString);
}
}
O / P:
steckoverflow is e very good website
source
share