【发布时间】:2013-05-19 21:30:01
【问题描述】:
我有一个文本文件:
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 之后和goal 之前的所有行。
文件中有很多Something 和goal。我应该使用数组或其他东西...?
【问题讨论】: