Question: Java problem Trying to censor the unwanted word with *, however it censors every word that has the unwanted word in it. How to only

Java problem

Trying to censor the unwanted word with *, however it censors every word that has the unwanted word in it. How to only censor the unwanted word itself regardless of the captial letter? Thanks

Sample output:

please enter the paragraph you would like filtered: Applepie applejuice Appleorange applebanana apple Apple

please enter the word you would like to filter: apple

output: Applepie applejuice Appleorange applebanana ***** *****

Java problem Trying to censor the unwanted word with *, however itcensors every word that has the unwanted word in it. How to

import java.util.Scanner; public class Random public static void main(String[l args) Scanner input - new Scanner(System.in); System.out.println("Please enter the paragraph you would like filtered: "); string paragraph = input.nextLine(); System.out.println("Please enter the word you would like to filter:" string wo rd = input.nextLine(); System.out.println("Unfiltered: "paragraph) String filter = ""; for (int i=0; i

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!