Question: JAVA Programming Write a program to read in a LINE from the user and replace all digits in the String with an underscore (_). Create
JAVA Programming
Write a program to read in a LINE from the user and replace all digits in the String with an underscore (_). Create a Scanner that reads from System.in. Do the following WHILE the user doesnt enter an empty String. Ask the user to enter a string. Read the String with nextLine(). Create an empty output String. For each character, check if it is a digit (you can use Character.isDigit()). If it is, append an underscore to the output String. Otherwise, append the original character to the output String. Print the output String.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
