Programming Examples

Java program to remove the specific word from sentence


Write a program to accept a sentence which may be terminated by either ‘.’ ‘?’ or ‘!’ only. Any other character may be ignored. The words may be separated by more than one blank space and are in UPPER CASE.

Perform the following tasks:

(a) Accept the sentence and reduce all the extra blank space between two words to a single blank space.

(b) Accept a word from the user which is part of the sentence along with its position number and delete the word and display the sentence.

Test your program with the sample data and some random data

Output

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz