111,126
社区成员
发帖
与我相关
我的任务
分享using System;
using System.IO;
using System.Collections.Generic;
using System.Text.RegularExpressions;
class Program
{
static void Main()
{
List<string[]> list = new List<string[]>();
using(TextReader txt = new StreamReader("test.txt"))
{
string line;
while ((line = txt.ReadLine()) != null)
{
list.Add(Regex.Split(line.Trim(), "\\s+"));
}
}
string[][] array = list.ToArray(); // 这就是你要的。
}
}