I have the following code snippet
/* I have got the file. Now moving to the desired place */
Scanner in_chap = new Scanner(chap);
in_chap.useDelimiter(qa_delimiter);
while (in_chap.hasNext()) {
String str = get_my_info();
/* Now I need to replace the the current line with str */
}
Is there way to use the scanner reference to write str to the new offset? If I cannot is there any other way to do it? I need to use scanner to get to that line. Now I want to replace that with new string…
No, as the name says, it’s a
Scanner, it’s only used for reading, not for writing.