In this post, we will see “How to reverse characters of a word and also how to reverse words in a String in Java 8?”. To achieve that, we are going to use Stream API introduced in Java 8 and StringBuilder to reverse the string. 

See what we are looking to achieve here:

Reverse Character & Word in a String in Java 8 with example...!!! Share on X

In this tutorial, we are going to cover below topics:

  1. How to reverse Character of a Word?
  2. How to reverse Word in a String?

Example 1. Java code to reverse character in a word

Output:

Example 2. Java code to reverse word in a string

Output:

Reverse Character & Word in a String in Java 8 with example...!!! Share on X

Do you like this Post? – then check my other helpful posts:

Other Useful References:

Author

  • Deepak Verma

    Deepak Verma is a Test Automation Consultant and Software development Engineer for more than 10 years. His mission is to help you become an In-demand full stack automation tester. He is also the founder of Techndeck, a blog and online coaching platform dedicated to helping you succeed with all the automation basics to advanced testing automation tricks.

    http://Techndeck.com deepak.rkgit@gmail.com Verma Deepak