This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages 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