Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get reverse string

 
nagarjuan pula
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 93
IntelliJ IDE Java VI Editor
 
nagarjuan pula
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you sampath.its working
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic