Hi, I am trying to implement search and replece function of notepad in Java. 1)can anybody explain me / give an idea of, how to search for a text in a file. is there any fseek command for searching or I need to read the line(readln()) and serach word by word? 2) Once I find the text wanted to replace the text with new text and store it in the file. how can implement this? I really appreciate your feedback. Thanks, padmashree
posted 14 years ago
Hi , Try to Use StringBuffer Class. That class contains replace() method that will help you. Use String Class to identify the index of the search String and replace that String with your newString in StringBuffer Class. Just Try that. If you need any help please let me know. Shiva.
What a show! What atmosphere! What fun! What a tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads