当字符串[],_ lineParts被添加到List时,我在List中看到的只是"System.String []"需要做什么来查看列表中的实际string []值.
while (_aLine != null)
{
//split the line read into parts delimited by commas
_lineParts = _aLine.Split(new char[] { ' ', '\u000A', ',', '.', ';', ':', '-', '_', '/' },
StringSplitOptions.RemoveEmptyEntries);
//keep things going by reading the next line
_aLine = sr.ReadLine();
//words = _lineParts;
if (_lineParts != null)
{
//_words.Add(_lineParts.ToString());
wrd.Add(_lineParts.ToString());
}
}
Run Code Online (Sandbox Code Playgroud)
Adi*_*dil 18
更改
wrd.Add(_lineParts.ToString());
Run Code Online (Sandbox Code Playgroud)
至
wrd.AddRange(_lineParts);
Run Code Online (Sandbox Code Playgroud)