我有一个文本文件:
hh
Something sdf....
one line
empty line
other line
goal
Something apf ee
one line
goal
List<String> goo = new List<String>();
System.IO.StreamReader file = new System.IO.StreamReader("text.txt");
while (file.EndOfStream != true)
{
string s = file.ReadLine();
if (s.Contains("Something"))
{
goo.Add(s);
}
}
我想在 之后Something
和 until得到所有行goal
。有很多Something
和goal
在文件中。我应该使用数组或其他东西......?