replace all occurrences of a character in a string java

Solutions on MaxInterview for replace all occurrences of a character in a string java by the best coders in the world

showing results for - "replace all occurrences of a character in a string java"
Shaun
13 Nov 2019
1String phrase = "An_Apple_A_Day_Keeps_The_Doctor_Away";
2System.out.println(phrase.replaceAll("_", " ");
3// prints 'An Apple A Day Keeps The Doctor Away'
4