publicclass MainClass {
publicstaticvoid main(String[] arg) {
String text = "To be or not to be, that is the question.";
String newText = text.replace(' ', '/'); // Modify the string text
System.out.println(newText);
}
}
To/be/or/not/to/be,/that/is/the/question.
2.21.String Replace
2.21.1.
To replace one specific character with another throughout a string