Method to find string inside of the text file. Then getting the following lines up to a certain limit

前端 未结 7 561
孤街浪徒
孤街浪徒 2020-12-08 15:35

So this is what I have so far :

public String[] findStudentInfo(String studentNumber) {
                Student student = new Student();
                Scan         


        
7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-08 16:17

    Using the Apache Commons IO API https://commons.apache.org/proper/commons-io/ I was able to establish this using FileUtils.readFileToString(file).contains(stringToFind)

    The documentation for this function is at https://commons.apache.org/proper/commons-io/javadocs/api-2.4/org/apache/commons/io/FileUtils.html#readFileToString(java.io.File)

提交回复
热议问题