wood burning stoves*
The moose likes Beginning Java and the fly likes RE:reversing a string program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "RE:reversing a string program" Watch "RE:reversing a string program" New topic
Author

RE:reversing a string program

Vidya Bhargavi
Greenhorn

Joined: Jul 09, 2009
Posts: 26
Hi,


input:"welcome to cornet"
output:"emoclew ot tenroc"


Can anyone please write a program with the above specified input to get the desired output.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18103
    
  39

Vidya Bhargavi wrote:Can anyone please write a program with the above specified input to get the desired output.


What have you tried? And what issues have you run into? ... and you should read this...

http://faq.javaranch.com/java/NotACodeMill

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Miklos Szeles
Ranch Hand

Joined: Oct 21, 2008
Posts: 142
Yes, we can. And you can too;) We can help if you stucked somewhere but we won't write theprogram instead of you. So I advice you to try to do it yourself and come back some code what you wrote when you stucked.
Vidya Bhargavi
Greenhorn

Joined: Jul 09, 2009
Posts: 26
Hi,



i tried reverse method in stringbuffer class.....

but i am able to reverse the input as a whole sentence only....

i need that to be done word by word as specified above....

please give me the logic for that
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

Can you find the word boundaries? If so, you can use those to reverse only parts of the String.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Vikash Ananda
Ranch Hand

Joined: Oct 12, 2009
Posts: 32
First Help:

Do some Homework

Second Help:

1. use loops
2. see for documentations
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RE:reversing a string program
 
Similar Threads
unexpected output
[Easy]hyphen
how totake user input for the string for this program ?
ServletStream
Same Code Different Behaviour