Java program to delete words from sentence

In this post, we will see how to delete words from the sentence.
You can just use String’s replaceAll method to replace the word with empty String("").
Here is simple java program to delete words from the sentence.

Output:

Enter a String : Java2Blog is a technical blog.
Enter a Word you want to Delete from the String : technicalNew String is : Java2Blog is a blog.

Was this post helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *