[Logo]
Forums Register Login
how to get reverse string
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.
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);
Or you can use http://download.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/java/lang/StringBuffer.html#reverse() to do that.
Thank you sampath.its working
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Oct 20, 2017 02:44:26.