Java program to delete words from sentence

Previous
Next

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.

Previous
Next

Join Our News Letter – Stay Updated

Subscribe to Awesome Java Content.




Add Comment

Join Our News Letter - Stay Updated

Subscribe to Awesome Java Content.
You can like our facebook page Java2blog