Problem: I want to read a file and replace a particular string with new value.
I know we can update a file using RandomAccessFile. But question is how to search for a particular String in RandomAccessFile.
Printable View
Problem: I want to read a file and replace a particular string with new value.
I know we can update a file using RandomAccessFile. But question is how to search for a particular String in RandomAccessFile.
Read the contents of the file as a String and search that String for the particular String.Quote:
how to search for a particular String in RandomAccessFile.