+replace(oldchar,newchar);
Return type String
Returns a new string that replaces all matching characters in this string with the new character.
import java.lang.String;
class replace{
public static void main(String[] arg){
System.out.println("Welcome : "+"Welcome".replace('e','E'));
}
}
Output: Welcome : WElcomE
Returns a new string that replaces all matching characters in this string with the new character.
import java.lang.String;
class replace{
public static void main(String[] arg){
System.out.println("Welcome : "+"Welcome".replace('e','E'));
}
}
Output: Welcome : WElcomE