-4

我想从简历中获取具体的内容,比如姓名和年龄。如何用 C# 做到这一点。也许是正则表达式?</p>

4

1 回答 1

0

一种简单的方法是使用不带参数的string.Split(按空格字符分割):

using (StreamReader sr = new StreamReader(path)) 
{
    while (sr.Peek() >= 0) 
    {
        string line = sr.ReadLine();
        string[] words = line.Split();
        foreach(string word in words)
        {
            foreach(Char c in word)
            {
                // ...
            }
        }
    }
}

让我知道,如果你有任何问题。

于 2013-07-29T15:31:02.893 回答