正如标题所说,我想在文本文件中搜索特定单词,然后从该点开始阅读文本。
代码片段如下
Dim path As String = "c:\temp\test.txt"
Dim readall As String
Dim i As Integer
If File.Exists(path) Then
File.Delete(path)
End If
Dim sw As StreamWriter = New StreamWriter(path)
sw.WriteLine("Hello")
sw.WriteLine("i am here")
sw.WriteLine("to test")
sw.WriteLine("the class")
sw.Close()
Dim sr As StreamReader = New StreamReader(path)
readall = sr.ReadToEnd
sr.Close()
所以现在我已经阅读了文件并将其存储到字符串 readall 中。我怎样才能写回文件,但现在从“到”这个词开始例如输出文本文件将是
测试类
我希望我说清楚了