Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Java Micro Edition and the fly likes how to get reverse string 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 » Mobile » Java Micro Edition
Bookmark "how to get reverse string" Watch "how to get reverse string" New topic
Author

how to get reverse string

nagarjuan pula
Greenhorn

Joined: Sep 20, 2010
Posts: 9
Hi,

can any one can explain how to display the given string as reverse string. if you have example code post that.

thanks in advance.
sampath premarathna
Greenhorn

Joined: Oct 05, 2010
Posts: 13
I think this will help you

String as="htapmas";
String temp="";
for(int x=as.length()-1;x>-1;x--){
temp+=as.charAt(x);
}
System.out.println(temp);
Eduardo YaƱez Parareda
Ranch Hand

Joined: Oct 09, 2008
Posts: 92

Or you can use http://download.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/java/lang/StringBuffer.html#reverse() to do that.


http://serfj.sourceforge.net - Simplest Ever REST Framework for Java
nagarjuan pula
Greenhorn

Joined: Sep 20, 2010
Posts: 9
Thank you sampath.its working
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to get reverse string
 
Similar Threads
Stringreversal
reversing a string using recursion
Regarding String Object Reversing
how to get reverse string
Return a reversed number