How Do You Reverse a String in Word in Java

How Do You Reverse a String in Word in Java

public class StringFormatter {public static String reverseWord(String str){String words[]=str.split(“\\s”);String reverseWord=””;for(String w:words){StringBuilder sb=new StringBuilder(w);sb.reverse();reverseWord+=sb.toString()+” “;

How do you reverse words in Word?

  1. Insert a text box in your document by selecting Insert > Text Box, and then type and format your text.
  2. Right-click the box and select Format Shape.
  3. In the Format Shape dialog box, select 3-D Rotation on the left.
  4. In the X box, enter 180°. Notes:

How do you reverse a string?

  1. public class Reverse.
  2. {
  3. public static void main(String[] args) {
  4. String string = “Dream big”;
  5. //Stores the reverse of given string.
  6. String reversedStr = “”;
  7. //Iterate through the string from last and add each character to variable reversedStr.
  8. for(int i = string.length()-1; i >= 0; i–){
Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.