Question: Java help. I am using the String Replace All method in the while loop to remove the vowels(uppercase and lowercase). I am not receiving any

Java help. I am using the String Replace All method in the while loop to remove the vowels(uppercase and lowercase). I am not receiving any output when I run the program. The code is listed below:

package Practice; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; public class ReplaceAll {

public static void main(String[] args) throws IOException { InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8); BufferedReader in = new BufferedReader(reader); System.out.println("Enter a word: "); String str = in.readLine(); while ((str = in.readLine()) != null) { String new_str = str.replaceAll("[aeiouAEIOU]", ""); System.out.println(new_str); } }

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!