Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

character position in a file  RSS feed

 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
is there any method to find the position of a character , say "}" in a file.
Thanks in advance
Rajeev..
Sun Certified Java Programmer.
Sun Certified Web Component Developer.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not in a single method. Probably the simplest approach is to first read the file contents into a String, and then search the String using the indexOf() method. Or for more elaborate types of searches you can use the java.util.regex classes. Does that give you some idea how to proceed?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!