Javatpoint Logo
Javatpoint Logo

Java Program to reverse tOGGLE each word in String

We can reverse tOGGLE each word of a string by the help of reverse(), split(), toLowerCase(), toUpperCase() and substring() methods. By the help of split("\\s") method, we can get all words in an array. To get the first character, we can use substring() or charAt() method.

Let's see the example to reverse tOGGLE each word in a string.

File: StringFormatter.java

File: TestStringFormatter.java

Output:

yM eMAN sI nAHK
i mA oONOS lAWSIAJ
Next TopicJava String FAQs





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA