次のコードスニペットがあります
/* 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 */
}
スキャナー参照を使用してstrを新しいオフセットに書き込む方法はありますか?私ができない場合、それを行う他の方法はありますか?その行に到達するにはスキャナーを使用する必要があります。今、私はそれを新しい文字列に置き換えたいと思います...