Output:
Click Here For Java Online Compiler
Solution:
*** Replace Character With Other *** Original String: aleeee Replacing 'e' with 'y' New String: alyyyy
Click Here For Java Online Compiler
Solution:
class ReplaceChar { public static void main(String[] args) { System.out.println("*** Replace Character With Other ***" + "\n"); String string = "aleeee"; // Replace all the 'e' characters with 'y' characters. String newString = string.replace('e', 'y'); // Display the strings for comparison. System.out.println("Original String: " + string + "\n"); System.out.println("Replacing 'e' with 'y'"); System.out.println("New String: " + newString); } }
comment 0 comments:
more_vertsentiment_satisfied Emoticon