Méthode pour trouver une chaîne à l'intérieur du fichier texte. Ensuite, obtenir les lignes suivantes jusqu'à une certaine limite

C'est donc ce que j'ai à ce jour :

public String[] findStudentInfo(String studentNumber) {
                Student student = new Student();
                Scanner scanner = new Scanner("Student.txt");
                //Find the line that contains student Id
                //If not found keep on going through the file
                //If it finds it stop
                //Call parseStudentInfoFromLine get the number of courses
                //Create an array (lines) of size of the number of courses plus one
                //assign the line that the student Id was found to the first index value of the array
                //assign each next line to the following index of the array up to the amount of classes - 1
                //return string array
}

Je sais comment savoir si un fichier contient la chaîne de caractères que je suis en train d'essayer de trouver mais je ne sais pas comment faire pour récupérer l'ensemble de la ligne de son.

C'est mon premier temps à poster donc, Si j'ai fait quelque chose de mal s'il vous plaît laissez-moi savoir.

source d'informationauteur Joel Sanchez