I want to create a small program where I can enter a string using a scanner, and replace characters. For example, every "a" in the string should be replaced with a "4".
I have this sourcecode:
Scanner s = new Scanner(System.in);
String string = s.nextLine();
System.out.println("Your old text:" + original_string);
string.replace("i", "1");
string.replace("a", "4");
System.out.println("Your new super awesome text: " + string);
For example, if I input "ia", it should return "14". Unfortunately, this does not happen.