Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to reverse the contents of a text file

 
aakash bose
Greenhorn
Posts: 4
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guyz!! I want to read the characters from a text file and print each character in reverse order. e.g
if the file SAMPLE.txt is:
abc
def
ghi

my output should be
ihj
fed
cba


 
K. Tsang
Bartender
Posts: 3401
13
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to check the JavaRanch jr.jar javadoc Str class. http://www.javaranch.com/doc/com/javaranch/common/Str.html

Or other API that does string manipulation rather than writing your own.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic