About 81,800 results
Open links in new tab
  1. Reverse a string in Java - Stack Overflow

    Sep 10, 2017 · I have "Hello World" kept in a String variable named hi. I need to print it, but reversed. How can I do this? I understand there is some kind of a function already built-in into …

  2. What is the most efficient algorithm for reversing a String in Java ...

    Mar 14, 2010 · What is the most efficient way to reverse a string in Java? Should I use some sort of xor operator? The easy way would be to put all the chars in a stack and put them back into …

  3. Reversing a String with Recursion in Java - Stack Overflow

    The function takes the first character of a String - str.charAt(0) - puts it at the end and then calls itself - reverse() - on the remainder - str.substring(1 ...

  4. java - Reversing a String from user's input - Stack Overflow

    For loop** - Looping over each character of the string starting from last character of the string. reverse** - appending each char to form new string. I would suggest to use StringBuilder …

  5. string - Reverse a given sentence in Java - Stack Overflow

    Can anyone tell me how to write a Java program to reverse a given sentence? For example, if the input is: "This is an interview question" The output must be: "question interview an is this"

  6. How can I reverse a single String in Java 8 using Lambda and …

    Nov 27, 2017 · I have one string say "Aniruddh" and I want to reverse it using lambdas and streams in Java 8. How can I do it?

  7. Whats the best way to recursively reverse a string in Java?

    May 14, 2009 · That's definitely how I'd go about recursively reversing a string (although it might be nice to extend it to the case of an empty string in your condition.) I don't think there is any …

  8. reversing a String in java - Stack Overflow

    May 9, 2011 · As said, reversing a String object is not possible, as string objects in Java are immutable. You could circumvent this by using reflection to access the underlying array (see …

  9. java - What is the Simplest Way to Reverse an ArrayList ... - Stack ...

    May 26, 2012 · As of Java 21 you can use ArrayList#reversed(). Where ArrayList implements SequencedCollection. This is part of Sequenced Collections added to the Collections framework.

  10. Reverse words in a string using lambda expressions

    Dec 9, 2015 · Your task description is a bit ambiguous. I couldn’t recognize whether you have to reverse the words or reverse the characters of the words. But here are solutions for both: …

Refresh