This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes How to reverse the input string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to reverse the input string" Watch "How to reverse the input string" New topic
Author

How to reverse the input string

Phil Maqui
Greenhorn

Joined: Oct 08, 2011
Posts: 10

i tried finding stuff on the net on how to do this, but all in vain, can anyone help me on this?


https://www.warpportal.com/landing/ragnarok/registration.aspx?ref=5688322

Chiranjeevi Kanthraj
Ranch Hand

Joined: Feb 18, 2008
Posts: 289



-Chiru
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

Although a StringBuilder should be preferred over a StringBuffer unless you need the synchronization, that will work. It will not be a valid answer to any homework assignment though.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38045
    
  22
Phil Maqui wrote:i tried finding stuff on the net on how to do this, but all in vain, . . .
Just as well you didn’ find anything. As you will see here,
We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.
. . . you are better off working it out for yrruself.

To work it out for yourself, you need some very high-technology with curvilinear frictional recolorisation, two-dimensional illuminative inspection capabilities, and polymeric deletion. That means: pencil, paper and eraser The last-named is probably the most important.
Write down what you think you want to do to reverse the String. Hint: go through the String class, and you will find methods which can supply you with the information you need from the String. Once you have it written down, and got it into words of one syllable, then you have it in a form the computer can understand, and which you can convert to code.
Harsha Smith
Ranch Hand

Joined: Jul 18, 2011
Posts: 287
unsual way of reversing a string

String s = "why don’t you read the previous posts so you know not to give a whole answer?";
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38045
    
  22
Please read the previous posts, then you will see why you ought not to have posted the solution. I have pulled rank and deleted it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to reverse the input string
 
Similar Threads
Ant and Cactus - classpath issues
http-method not specified
Clock problem
thanks!!! another SCJP born~
Args in Netbeans