| 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: 283
|
|
|
|
-Chiru
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
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
How To Ask Questions How To Answer Questions
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32620
|
|
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: 32620
|
|
|
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: jrebel
|
|
subject: How to reverse the input string
|
|
|