当字符串[],_ 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());
}
}
答案 0 :(得分:57)
使用List.AddRange代替List.Add
答案 1 :(得分:18)
答案 2 :(得分:4)
您可以在使用List.AddRange()
List.Add()