【发布时间】:2013-03-06 10:33:24
【问题描述】:
我从一个文本文件 (.txt) 编写程序,我必须使用函数 split 切断世界的界限。但我不知道这个世界如何在函数中写入数组并使用它。
有代码:
private void button1_Click(object sender, EventArgs e)
{
FileStream fs = new FileStream("text.txt", FileMode.Open);
StreamReader sr = new StreamReader(fs);
string line;
while ((line = sr.ReadLine()) != null)
{
string[] slova = sr.ReadLine().Split(';');
}
sr.Close();
}
【问题讨论】:
-
我不明白你的问题
-
看不懂你,你想对每一行的
string[]做什么? -
发布您尝试解析的示例文本